Silverlight RIA Services - Display Columns from Multiple Tables

I am evaluating Silverlight and .NET RIA Services for my company. I'm trying to decide if this is right for us. For the most part, I like it. But, I see one point that I am surprised that I cannot do it easily. Because of this, I am assuming that I am doing something wrong. To demonstrate, I have two database tables:

Order
-----
ID
CustomerID
OrderDate
OrderNumber

Customer
--------
ID
FirstName
LastName
Address

      

When I create the Domain Service class, I select both of these tables. In a Silverlight application, I drag an Order object from the Data Sources page to the Silverlight page. When I do this, the DataGrid is added with all the properties in the Order object. Actually, I would like the DataGrid to show:

  • Order.OrderNumber
  • Order.OrderDate
  • Customer.FirstName
  • Customer.LastName

Since this information is spread across multiple tables, I'm not sure how to use RIA services to expose them in a Silverlight application.

What's the recommended way to do this? Should I add a view to my database? Can I do this without touching the database?

Thanks,

+2


a source to share


1 answer


This applies to our stuff, but the logic will be the same for how you create a new request and a custom class in your service, which will then be callable through your domain context, grid / list bindings, etc.



WCF RIA Services handling multiple tables

+1


a source







All Articles