title: Using generic Dictionary over wcf: what do I need to look for?
body: <p>Suppose I have a WCF service and a method in the contract </p>
  
  <pre><code>&lt;ServiceContract()&gt; _
  Interface IThingService
  '...
    &lt;OperationContract()&gt; _
    Function GetThing(thingId As Guid) As Thing
  End Interface
  </code></pre>
  
  <p>where Thing is an ordinary class with ordinary properties, except for one member:</p>
  
  <pre><code>Public Class Thing
    ' ...
    Public Property Photos() As Dictionary(Of String, Photo) 
    ' ...
  End Class
  </code></pre>
  
  <p>where Photo is an ordinary class with ordinary properties. </p>
  
  <p>So I dove into some documentation such as <a href="http://msdn.microsoft.com/en-us/library/aa347850.aspx" rel="nofollow noreferrer">this MSDN article</a>, and <a href="http://www.request-response.com/blog/PermaLink,guid,ff5fab81-affb-4b2b-aa67-c80bdfc86cbd.aspx" rel="nofollow noreferrer">this blog post</a>, and now I am confused if I have to understand a lot about the DataContractSerializer and the particulars of how the service serializes the Photos property.  </p>
  
  <p>Do I need to go there, or is there something I can do to let WCF on the server interact with my client automatically?  Seems to me all the serialization details should be able to be abstracted away--I just want to end up, in the consuming client app, with:</p>
  
  <pre><code>Dim foo as Thing = ThingServiceClient.GetThing(someGuid)
  Dim myPhotos as Dictionary(Of String, Photo) = foo.Photos
  </code></pre>
  
  <p>What do I need to do in my definition of Thing to make this work?  Anything I need to do elsewhere to get this to work?  Do I need to worry about ensuring the service sticks to the DataContractSerializer and doesn't fall back to use the XmlSerializer?</p>