Using WCF RIA Services to include multi table master-detail data
When you see demonstrations of technologies most of the time the data samples show single table solutions. When was the last time you’ve developed a single-table system? Thought so.
In RIA Services demonstrations, most of them have been single-table samples as well. So how do you go about retrieving relational data (master/details type) with RIA Services? Here’s an option. Modify the Visual Studio generated MetaData class to add an [include] attribute on top of your chosen EntityCollection<T> and then add a method to our Domain Service class to get the additonal data. e.g.
public EntityCollection<Album> Albums;
public IQueryable<Artist> GetArtistsWithAlbums()