[Serialize] attribute

9 posts, 1 answers
  1. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 11 Oct 2010 Link to this post

    Hi,

    Can telerik open access generate classes with [Serialize] attribute using Reverse Mapping?

    Many thanks.

    MG
  2. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 11 Oct 2010 Link to this post

    Hi M G,

    If you use the latest version you can customize the T4 code template that is used to generate the classes.

    Here is a thread that discusses this according to HTML encoding and decoding getters and setters for properties. It should get your started on how to add the [Serializable] attribute.

    Regards

    Henrik

  3. DevCraft banner
  4. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 12 Oct 2010 Link to this post

    HI Henry,

    Thanks for the pointer. I just need to have the label [Serialize] on each classes being generated. Therefore if you can think straight out of you head, could you please let me know where exactly do I have to make changes?

    Many thanks.

    MG
  5. Answer
    Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 12 Oct 2010 Link to this post

    Hi M G,
    If you are using 2010 c# please goto dsl2010\CodeGenerationTemplates\CSharp\Includes in the OpenAccess install directory, open General.ttinlcude. At line 371 you find the class generation method. Before

    this.WriteLine(classSignature);

    is called you can insert what you want to write above the classes. A

    this.WriteLine("[System.Serializable]");

    will do the job. Just play around a little bit.

    Regards,
    Jan Blessenohl
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 12 Oct 2010 Link to this post

    Hi Jan,

    Thanks for joining in - you hit the Reply button just before me :-)
    But I was having the same answer though - nothing to add there.

    Regards

    Henrik
  7. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 12 Oct 2010 Link to this post

    Thank a lot to both of you!

    Cheers,
    MG
  8. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 01 Jul 2011 Link to this post

    Hi,

    We upgraded OA version to the latest one. The trouble is how can I achieve or add "Serialize" atttribute to each classes being generated.At what line do I have to add the code for the new version.

    Many thanks.

    MG
  9. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 01 Jul 2011 Link to this post

    Sorry. Not to worry about the issue. I found a solution myself. Added in "specific.ttinclude" file.

    Thx,
    MG
  10. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 01 Jul 2011 Link to this post

    Hi Milan,

    I am glad to see that you managed to resolve the problem on your side.
    If any other problems arise, do not hesitate to contact us back.

    Regards,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Back to Top
DevCraft banner