Programmatic API for the Code Generators of LINQ-to-SQL and Entity Framework
What options do I have for generating class definitions for LINQ-to-SQL and Entity Framework context and data entity objects? I understand how to use the Visua开发者_StackOverflowl Studio tools, but is there a programmatic API I can use to define the model and generate the corresponding code from another application?
Linq to SQL options aren't great -- best thing I know of is L2ST4 which at least gives one much more control over the generated classes. The designer document is a big, fancy XML file so I guess you could make something that generates it externally if you were so motivated.
Entity Framework has much better options -- especially since v 4.1 gives you code-first. So that means all you need to do is generate a C# class and then EF handles the rest.
精彩评论