How to add Serializable attribute to generated classes

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

How to add Serializable attribute to generated classes

Post by lasseschou » Tue 12 Jan 2010 09:58

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 13 Jan 2010 08:21

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.

lasseschou
Posts: 13
Joined: Mon 23 Nov 2009 08:59

Post by lasseschou » Wed 13 Jan 2010 09:39

Perfect, thanks!

Post Reply