我需要使用实现以下接口的 Reflection.Emit 生成一个类。
public interface IObject
{
T Get<T>(string propertyName);
}
有没有人有一个例子说明我如何将以下内容作为一个简单的测试用例发出?
class GeneratedObject : IObject
{
public T Get<T>(string propertyName)
{
// this is the simplest possible implementation
return default(T);
}
}