Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq-to-SQL Design question!

What if you need to create POCO objects from a dbml file? Do you use a generator and who? You write the POCO's manually? Say you like to make your objects Persistent Ignorant and share to clients, then create a DAO pattern for the communication between Client - DAO - L2S Objects, this is a question for disconnected design using Linq 2 SQL. Supposed that the POCO's using the client should be as much as primitive as they can be without dependencies (EntityRef<>, EntitySet<>, Attributes, etc.), and ofcourse you could cast the L2S object into the POCO with the appropriate DATA. Any help and any corrections on the concept would be really helpful!

like image 421
George Taskos Avatar asked Jan 23 '23 18:01

George Taskos


1 Answers

I would be tempted to say "wait until EF in .NET 4.0", which has much improved POCO support (compared to EF current) and hopefully a POCO T4 template in VS2010.

At the moment SqlMetal will emit rich objects; while LINQ-to-SQL can work on POCO types, you would have to write the POCOs yourself, or use xslt / T4 / whatever on the dbml.

like image 104
Marc Gravell Avatar answered Jan 28 '23 13:01

Marc Gravell