开发者

Class definition copy-generation in C#

开发者 https://www.devze.com 2023-03-17 02:16 出处:网络
I have an assembly (DLL) created from the Early bound classes of dynamcis crm\'s code genaration tool. These classes mostly have properties.

I have an assembly (DLL) created from the Early bound classes of dynamcis crm's code genaration tool. These classes mostly have properties.

I want to use these classes as Model with additional control.

Like in java, is was looking forward to use reflection, but could not find example on it or introspection using FxCop

I tried using T4 toolbox (Decorator classes - here) but that does not support Properties. I also tried tools like CodeSmith but could not figure out if that is possible.

I was expecting Visual Studio or its extenstion should be easily do it.

Original Class

public class Product {
    public Guid Id { get; set; }
}

Generated class

public class ProducModel {
    public Guid Id { get; set; }
}

Maintainibility: If original class changes, would your suggested tool/method cope with that?

An开发者_StackOverflow社区y suggestions?


I ended up using "Go to Definition" (F12) feature of visual studio & copy/pasting the required properties.

Detailed answer on MS Forum

0

精彩评论

暂无评论...
验证码 换一张
取 消