How to handle List of dataContracts

Topics: General Discussion Forum
Jan 21, 2007 at 12:58 PM
I'm trying to figure out what is the best way to handle List of DataContracts in WCF Service Factory. In the final release you added the possibility of defining a MessageBodyMember of a MessageContract as a Collection, so a List<T> is automatically created.

But in ReferenceImplementation you used another approach : you created a CollectionDataContract and you exposed it in a MessageContract as single element.

So, what is in your opinion the best approach to be followed when using WCF Service Factory ?


Jan 21, 2007 at 8:23 PM
Hey Ivan,

Yeah, the column we added to support collections was actually done very late in the project since it was a pretty easy change. We didn't think it was very important to take the same approach in the RI. I know guidance is all about choosing a single/consistent approach based on the scenario, but I really don't think one of these options is any better than the other. I would just choose the one that gives you the programming experience (object model) you're happiest with. Sorry for any confusion we caused.