5

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?

Thomas
  • 3,348
  • 4
  • 35
  • 49

2 Answers2

2

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<>.

BenCr
  • 5,991
  • 5
  • 44
  • 68
2

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

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
Derek Beattie
  • 9,429
  • 4
  • 30
  • 44
  • Thanks, don't know why I didn't search "EF code first RIA" before. I'll give it a quick go then come back to accept your answer. – Thomas Mar 12 '11 at 14:31
  • 1
    Please vote: http://dotnet.uservoice.com/forums/57026-wcf-ria-services/suggestions/1579271-ef-dbcontext-code-first-domainservicedescription – Shimmy Weitzhandler May 19 '11 at 00:31