views:

128

answers:

5

I'm trying to build a simple proof-of-concept "business application" in Silverlight and I keep running into a wall in trying to get data in and out of the database. I'm currently trying to learn WCF RIA Services, but I'm stuck because I can't get Entity Framework to work with existing tables in my database (they don't show up in the model designer even though I add them via the wizard).

I'd still like to use RIA Services (I think), but I don't know how much I would lose by abandoning EF in the process. How closely are they tied together?

+1  A: 

The backend can be just about anything you want. If EF isn't working for then Linq to SQL is viable alternative. I believe there is even and "Add..." template provided for you.

Harold
+1  A: 

If EF is giving you issues I believe you can still use LINQ-to-SQL with RIA Services.

With RIA all that really matters is that you provide a domain service that extends the correct class (I don't remember what class). EF is nice because there is a template for a domain service to an EF model, but you should be able to generate the same template off a LINQ-to-SQL model.

Stephan
+1  A: 

All WCF RIA Services requires is an IQueryable provider - which you can write yourself, if you really, really want to :-)

WCF RIA Services is not tied to neither Entity Framework, nor Linq-to-SQL (although those two provide "out of the box" IQueryable providers, so they're probably your first bet).

marc_s
A: 

As Marc says, you are not limited to EF or Linq to SQL - here's an example of a demo in RIA Services and Entity Framework ported to replace EF with NHibernate for the persistence layer: http://blogs.msdn.com/b/brada/archive/2009/08/06/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-part-nhibernate.aspx

Steve Willcock
+1  A: 

The WCF RIA Services Wizard for adding a new Domain Service requires either a provider that supports DataContext or ObjectContext. EntityFramework, Linq2sql, and NHibernate fall into one of these two categories.

However, you can feel free to implement a DataService without using the wizard if so inclined.

I'd focus on the EF issues first(sql2005 is supported), as the wizard makes the process very easy to learn.

itchi
Once I figured out the problem with EF, everything else was super smooth. THanks for the advice to focus on that.
Ben McCormack