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?
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
I'm a little late to the party but for people still looking for this, like I was earlier, take a look at this NuGet package.
http://nuget.org/packages/RIAServices.EntityFramework
It provides a DbDomainService<>
base class similar to the LinqToEntitiesDomainService<>
.
精彩评论