AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Many-to-many relationships throw error when serialized #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set the Serialization Mode on the .dbml to Unidirectional.[1]
2. Set the IncludeDataContract option in Entities.cst to true.
3. Generate the entities.
4. Place a [field: NonSerialized] attribute on the public events in the 
entity base class.[2]
5. Attempt to serialize an entity with a many-to-many relationship using 
the DataContractSerializer.

What is the expected output? What do you see instead?
Expected the Entities generator to respect the .dbml Serialization Mode 
setting. Instead, the DataContract and DataMember attributes appear to 
have been placed everywhere.

What version of the product are you using?
Using release 1.3 on Windows Vista.

Please provide any additional information below.
Clara Oscura's article[3] pointed me in this direction.

[1] http://msdn.microsoft.com/en-us/library/bb546184.aspx
[2] 
http://www.netknowledgenow.com/blogs/onmaterialize/archive/2007/03/01/Don_2
700_t-serialize-your-delegates_2100_.aspx
[3] http://geekswithblogs.net/claraoscura/archive/2008/10/10.aspx

Original issue reported on code.google.com by panesofg...@gmail.com on 21 Jan 2009 at 8:54

GoogleCodeExporter commented 9 years ago
Hi,  What error are you getting?  Are you just reporting the the generated code 
is
different then you expected?  Plinqo has some additional support for 
serialization
that the dbml designer doesn't.  Have you tried detaching before serializing?

Original comment by paul.wel...@gmail.com on 28 Jan 2009 at 3:51

GoogleCodeExporter commented 9 years ago
I was receiving a circular reference. We're upgrading to CodeSmith 5 and PLINQO 
2.0,
which is working great. I'm not sure what wasn't working in 1.3, though I 
suspect
something may have changed with VS2008 SP1? Since moving to the new templates, 
I've
deleted the error I received.

Original comment by panesofg...@gmail.com on 28 Jan 2009 at 4:50

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 28 Jan 2009 at 5:07

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 28 Jan 2009 at 11:00

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 30 Jan 2009 at 4:48

GoogleCodeExporter commented 9 years ago

Original comment by shannon....@gmail.com on 7 Oct 2009 at 3:49