我需要使用Reflection.Emit生成一个实现以下接口的类。使用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);
}
}
我重写了这个问题;) – 2009-10-30 18:38:45