Using Reflection.Emit to create a class implementing an interface

前端 未结 5 525
暗喜
暗喜 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:30

    I believe AutoMapper and/or LinFu will do this for you. You can definitely create an instance of an interface using AutoMapper, I've done it.

提交回复
热议问题