Public Property support in Q2

Thread is closed for posting
2 posts, 0 answers
  1. Jason The
    Jason The avatar
    1 posts
    Member since:
    Sep 2009

    Posted 11 Sep 2009 Link to this post

    I've recently updated to Q2. When I use reverse mapping to generate classes it now comments out the public property code which was generated by Q1. Is there an option to uncomment this generated code?

    eg.
    the following is still available:

    private

     

    string description;

    but the following is commented out:

     

    [Telerik.OpenAccess.FieldAlias("description")]

    public string Description

    {

       get { return description; }

       set { this.description = value; }

    }

  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 14 Sep 2009 Link to this post

    Hi Jason The,

     The Reverse mapping wizard generates partial classes by default. So for each class you would have 2 files - <classname>.cs and <classname>.Telerik.OpenAccess.cs.

     Every time you generate a class again (with some changes) the <classname>.Telerik.OpenAccess.cs file is regenerated with your changes. You can add custom code to the <classname>.cs file and it is not replaced by the wizard.

    Here is what you can do -
    1. If you use partial classes you can copy the commented property implementation and paste it in the <classname>.cs file
    2. You can switch off the 'Generate partial classes' option (available via the 'Options' toolbar button) so that the entire file is regenerated.

     Hope this helps.

    Sincerely yours,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top