开发者

Tool for POCO Generation

As a .Net hobbyist & newbie, learning c#, WPF, EntityFramework, LLBLgen WCF, I face problems while transferring objects between layers (mainly the Presentation Layer), as I work with classes having approximately 40 properties. (I don't reference the DAL in the Presentation Layer)

So here's what I decided, I am planning to build an App (maybe Visual Studio Addin) which will help noobs like me to build POCO's rapidly.

The GUI of the APP would probably be a datagrid with columns for

1) access modifiers

2) property name

3) data type

4) get method (checkbox)

5) set method (checkbox)

Also, the app will have an option to connect to the table and automatically generate a POCO class

I would like to generate Strongly typed C# / VB.NET POCO classes for different Scenarios, Like Entity Framework, LLBLgen etc.

I am main开发者_开发知识库ly targeting LLBLgen and EntityFramework

I need all the help/insights/references that I can get from the .Net Gurus over here


I need the following information:

1) Is there such a tool which already exists

2) What are the things that I have to consider (like nullable types etc)

3) The DataTypes generate by ORM's LLBLgen/EF/nHibernate

4) GUI ideas

5) Your Suggestions


Are you looking to do this at Runtime or Compile time?

Compile time is quite straight forward, in Entity Framework 4 there are supported templates for generating POCO's and Self Tracking Entites as part of the framework.

http://blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx

http://blogs.msdn.com/b/efdesign/archive/2009/03/24/self-tracking-entities-in-the-entity-framework.aspx

http://msdn.microsoft.com/en-us/library/dd456853.aspx

http://blogs.msdn.com/b/efdesign/ - most up to date EF info

You could look at crafting somehting yourself using T4 templates (built into VS) but thats exactly what the above templates are.

Doing it at Runtime gets a lot harder, using something like reflection.Emit.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜