Answered by:
Entities Seem directly coupled to database

Question
-
I am new to Linq to SQL and have yet to look at Linq to Entities. I like to design in sort of a domain driven design manner where I have a set of generic classes implemented as business objects. data is loaded into these objects using a repository. I have used nHibernate to implement this pattern.
I am looking to do something simular using Linq to SQL. It seem the "entity" classes used are very much bound to database tables.
I have seen how classes can be wired to tables using attributes and an xml file, but there still seems to be quit a bit of development to do for each of these classes.
is it reasonable to use Linq to SQL or Linq to Entities for this type of thing.
thanks
Wednesday, July 14, 2010 6:55 PM
Answers
-
I like to design in sort of a domain driven design manner where I have a set of generic classes implemented as business objects. data is loaded into these objects using a repository. I have used nHibernate to implement this pattern.
Hello,
Welcome to LINQ to SQL forum!
I would suggest you use Entity Framework 4 (LINQ to Entities) in VS2010, since it supports POCO classes. Here are some great references introducing POCO support in EF4:
http://blogs.msdn.com/b/adonet/archive/2009/12/22/poco-proxies-part-1.aspx
http://blogs.msdn.com/b/adonet/archive/2010/01/05/poco-proxies-part-2-serializing-poco-proxies.aspx
If you have any questions, please feel free to let me know.
Good day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Proposed as answer by Michael Sun [MSFT]Microsoft employee Tuesday, July 20, 2010 1:07 AM
- Marked as answer by Michael Sun [MSFT]Microsoft employee Thursday, July 22, 2010 1:26 AM
Thursday, July 15, 2010 2:35 AM
All replies
-
I like to design in sort of a domain driven design manner where I have a set of generic classes implemented as business objects. data is loaded into these objects using a repository. I have used nHibernate to implement this pattern.
Hello,
Welcome to LINQ to SQL forum!
I would suggest you use Entity Framework 4 (LINQ to Entities) in VS2010, since it supports POCO classes. Here are some great references introducing POCO support in EF4:
http://blogs.msdn.com/b/adonet/archive/2009/12/22/poco-proxies-part-1.aspx
http://blogs.msdn.com/b/adonet/archive/2010/01/05/poco-proxies-part-2-serializing-poco-proxies.aspx
If you have any questions, please feel free to let me know.
Good day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Proposed as answer by Michael Sun [MSFT]Microsoft employee Tuesday, July 20, 2010 1:07 AM
- Marked as answer by Michael Sun [MSFT]Microsoft employee Thursday, July 22, 2010 1:26 AM
Thursday, July 15, 2010 2:35 AM -
Hi,
I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?
If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.
Have a nice day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.Tuesday, July 20, 2010 1:07 AM