Using Reflection.Emit to create a class implementing an interface

前端 未结 5 522
暗喜
暗喜 2020-12-14 04:03

I need to generate a class using Reflection.Emit that implements the following interface.

public interface IObject
{
    T Get(string propertyName);         


        
5条回答
  •  心在旅途
    2020-12-14 04:24

    If you're using Reflection.Emit, you really ought to grab a copy of the Reflection.Emit language add-in for Reflector. While not perfect, it should get you at least 95% of the way to any given emitted code.

提交回复
热议问题