Passing Entities Between WCF and Silverlight

    I’ve been writing away about binding modes, ObservableCollections, XAML binding goodness, WCF, SOAP, Cross domain policies, converters, and third party web services … but tonight I started writing about passing entities between physical tiers in a Silverlight application. I know this material cold, but the hardest part of writing this chapter is deciding on what to include and what to exclude.

    I want to deal with passing entities and Silverlight, that is the focus. So I am writing about creating services that can pass them, how to set them up, how to consume them, etc. But then I can get into custom entities, LINQ to SQL, NHibernate, Entity Framework, Paul WIlson’s ORMapper, and more. I really don;t want this to turn into a crazy entity book … even though I love this topic …. so I won’t go there.

    I decided that I will discuss using entity models from some of these tools. But the main focus will remain true to how to use models with Silverlight. The chapter also discusses other topics, too … but this one topic could have been blown out of proportion :) If you want to learn EF, LINQ to SQL or NHibernate, there are better books to choose form. This book is for intermediate developers who want to learn how to deal with data and services with Silverlight.

    image

    DotNetKicks Image
    #1 Dew Drop - August 18, 2008 | Alvin Ashcraft's Morning Dew on 8.18.2008 at 9:53 AM

    Pingback from Dew Drop - August 18, 2008 | Alvin Ashcraft's Morning Dew



    #2 Steve on 1.19.2009 at 6:50 PM

    99% of the 'immediate developers' are going to pick a tool such as Linq to SQL, EF, or NHibernate and attempt to pass those models back and forth from Silverlight to , ie. Astoria.

    I think showing how is very important in a book that is discussing Data and Silverlight.

    I could learn how to pass a poco on a web tutorial in 2 minutes, I buy the books to learn the stuff your not going to cover ;)

    Sorry, didn't mean to be critical - just factual.



    #3 John Papa on 1.19.2009 at 7:19 PM

    Steve,

    Good points ... and perhaps this blog post could have been more descriptive. I wrote this as a "train of thought" post as I was writing chapter 5 (i think) of my book. I do cover passing POCO, EF entities and LINQ to SQL entities to Silverlight applications in my book. I also cover using Astoria with Silverlight. Its all good stuff.



    #4 Justin on 5.29.2009 at 6:57 PM

    I must be missing something, the title is "Passing Entities Between WCF and Silverlight" but it doesn't cover this at all. Maybe this is just an abstract??

    Anyway, if your Entities are in your WCF services project then how do you share those with your Silverlight app? You can't reference the Services project directly, you can't create a Silverlight class library that links to your edmx file because Silverlight class libraries don't support the required references, which leaves you in a scenario where your entities are duplicated under each service proxy namespace. So what's the secret to making this work??



    Leave a Comment