Adding [DataMember(Order=18, EmitDefaultValue=false)] on properties manually RRS feed

  • Question

  • Hi

    I am using a Linq to Sql class. What annoys me is that every time I have changes to my database and I drag the tables into my dbml file I need to add some attributes to my members on my classes.

    Like [DataMember(Order=18, EmitDefaultValue=false)]

    Is there a way I can avoid doing this manually?
    Thursday, May 21, 2009 8:12 AM

All replies

  • The following looks like it should help, because you won't have to remove the tables from the dbml files and drag them on again to update the schema:


    Write LINQ queries interactively -
    Sunday, May 24, 2009 9:36 AM
  • Check out the T4 templates that let you customize the output at They already include an option to emit more datamember attributes for SP1 compatible serialization. [)amien
    Sunday, May 24, 2009 7:28 PM