Data Contract Collection: collection type

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Nov 20, 2008 at 2:52 PM
Hello all,

I'm having a problem with the datacontract models. I can create a "data contract collection", and set the collection type. But when I close the datacontract model file and open it again, the collection type of my data contract collection has been forgotten (the collection type property is empty). When I press 'generate code', then building my solution will fail because the newly generated code (from the datacontract model) hasn't set the collection type to (for example) List.
I am experiencing the same problem with the "Primitive data type collection". The default collection type is set to "List", but when I change this (for example to Dictionary), close the model file and re-open it, the collection type is again set to "List".

I have taken a look at the xml-file (the xxx.datacontract file), and indeed: in the dataContractCollection-tag (or primitiveDataTypeCollection-tag) there is no attribute specifying what collection type to use.

What can I do so that the collection type is remembered? I generate my datacontract model with a tool I wrote (which makes data contracts based on the classes in a business entities assembly). In my model there are 100+ data contracts and data contract collections so it's (almost) not possible to change all the collection types by hand. Can I specify the collection type myself in the objectExtenderContainer-tag?

I am using Visual Studio 2008 (standard edition) with the latest release of WSSF (feb 27 2008).
Dec 18, 2008 at 10:10 AM
Hi kbouste,

install source code of the WSSF, and than attach source on the active SF process (process in which you are generate those models). Then set break point s in ServiceContractDSL project in file SerializationHelper.cs , class ServiceContractDslSerializationHelperBase and check Save methods. Than you can find out what is going on with serialization and where is the problem.

Jan 9, 2009 at 1:47 PM

I also have such a problem. The model looses itself some other Configuration things as well. Till now, I noticed that:
- the collection types
- the policy (by using Entlib extensions)
- the order of each property
are lost each time you proceed with such a manipulation.

For the Order property that's still ok since you can right-click an do re-order property easily. But for the rest, this bug is really heavy, overall if you work in collaboration with other colleagues, that have to do it by their own as well each time they need to go further with the project !