Page 1 of 1

How to add Serializable attribute to generated classes

Posted: Tue 12 Jan 2010 09:58
by lasseschou
Hi,

How do I get Entity Developer to include the attribute [Serializable] to all the generated classes? I can only make it generate the [DataContract()]. I hope you can provide a solution for this.

I'm using Entity Developer version 2.50.50

Thanks in advance,

Lasse

Posted: Wed 13 Jan 2010 08:21
by AndreyR
If you wish to add custom attributes like Serializable to the code generated for a LINQ to SQL model,
you should edit the code generation template.
Add the

Code: Select all

[Serializable]
line after the

Code: Select all

[Table(Name = @"")]
line.

Posted: Wed 13 Jan 2010 09:39
by lasseschou
Perfect, thanks!