Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use EF4 DbContext with Domain Service

I built my data access layer with the new code first stuff from Entity Framework 4, with a class derived from DbContext and various DbSet members.

Now I'm expanding to Silverlight and want to use WCF RIA services to access the DB. Do I have to start over with ADO.NET Entity Data Models, or is there some way to use what I've got?

like image 255
Thomas Avatar asked Oct 12 '22 13:10

Thomas


1 Answers

No, you shouldn't have to start over. You can create a domain service and not inherit from anything. Look at examples of how people use WCF RIA services with Nhibernate.

Here is some stuff about using RIA with ctp4. http://social.msdn.microsoft.com/Forums/en/adonetefx/thread/57793bec-abc6-4520-ac1d-a63e40239aed
http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/0e741f7f-700f-4efd-b10c-98f050f76c85

like image 135
Derek Beattie Avatar answered Oct 18 '22 02:10

Derek Beattie