Single Entity With WCF RIA and MVVM

Jul 14, 2011 at 10:32 AM

First a big thank you, I'm a relative newcomer to both Silverlight and MVVM, the Simple MVVM toolkit is the first one I have tried that has made sense to me!  I now have my first MVVM application up and running, lovely stuff!

I now want to move on and try something a little different.   Rather than have a VM that maps directly to a table containing  a large list of entities and filtering it to return subsets, I want to sum a bunch of custom totals/averages etc with custom code on the server so the client can retreive a single read only entity via WCF RIA that does not directly map to any specific table.  This would then feed into my "dashboard" View model.

I have found lots of posts on different sites referring to DTO's, POCO, etc which just succeeded in confusing me.  The clearest explanation I have found so far is by Jeff Handley on "DomainDataSource – Single Record Results".

I am having real difficulty working out how I would integrate this with MVVM and the rest of the toolkit.  Can anyone suggest any good blog post/resources that could help me out with my my current lack of knowledge?

 

 

 

Jul 14, 2011 at 4:40 PM

Just in case anyone was going to reply I think I have just answered my own question.   If there is any interest I can try and put together a tidy example to show what I have working, but if not I won't :)

Jul 14, 2011 at 9:56 PM
Oh yes, this is an easy one. Just add a method to your DomainService class that returns what you want. When you build the solution, the method will appear on the generated DomainContext class in the client, which you can call.

Cheers,

Tony
Sent from my iPad

On Jul 14, 2011, at 11:40 AM, "chamers"<notifications@codeplex.com> wrote:

From: chamers

Just in case anyone was going to reply I think I have just answered my own question. If there is any interest I can try and put together a tidy example to show what I have working, but if not I won't :)