我在C#中的对象,可以说20的属性,这是一个datacontract的一部分。我也有类似的性质,这是我想从响应对象来填充另一业务实体。有没有办法做到这一点比其他分配一个对象的每个属性其他相应的属性?
I have an object in C# with lets say 20 properties and it's part of a datacontract. I also have another business entity with similar properties, which I want to populate from the response object. Is there any way to do this other than assigning each property of one object to the corresponding properties of the other?
是的,看看 Automapper