This is a migrated thread and some comments may be shown as answers.

Public Property support in Q2

1 Answer 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason The
Top achievements
Rank 1
Jason The asked on 11 Sep 2009, 03:22 PM
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; }

}

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 14 Sep 2009, 05:30 PM
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.
Tags
General Discussions
Asked by
Jason The
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or