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

Reverse mapping not picking up changes to field\access\default.vm template

3 Answers 68 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron Kowall
Top achievements
Rank 1
Aaron Kowall asked on 14 Sep 2009, 03:24 PM
I recently upgraded to OpenAccess 2009.2.720.1 and was re-applying customizations I had made to the reverse mapping generation templates.
I can get my changes for class and lists, but my changes to field\access\default.vm don't seem to be picked up.  I have tried to make even minimal changes to that file thinking that maybe my template was incorrect and no matter what I do I get the same generation results.

Here is the contents of the template I am trying to apply:

[Telerik.OpenAccess.FieldAlias("$(fieldName)")]

public virtual $fieldType#if($isNullable)?#end#if($isArrayType)[]#end $fieldNameCaps

{

get { return $fieldName; }

set

{

if ($fieldName != value)

{

$fieldName = value;

OnPropertyChanged("$(fieldNameCaps)");

}

}

}

3 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 14 Sep 2009, 05:02 PM
Hello Aaron Kowall,
The user part of the generated classes are not regenerated if they already exist. If you look into the commented region at the end of the class.telerik.openaccess.cs file you will see that we use your changes.

You can delete the classes completely or copy the code from the comment to your part of the class.

Regards,
Jan Blessenohl
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.
0
Aaron Kowall
Top achievements
Rank 1
answered on 14 Sep 2009, 06:05 PM
Hi Jan,
That doesn't seem to work.  I deleted the class and regenerated.  I would expect to get this:
        [FieldAlias("officeID")]
        public virtual Guid OfficeID
        {
            get { return officeID; }
            set
            {
    if (officeID != value)
    {
     var originalValue = officeID;
     officeID = value;
     OnPropertyChanged("OfficeID", true, originalValue);
    }
            }
        }

but get this:
        [Telerik.OpenAccess.FieldAlias("officeID")]
        public Guid OfficeID
        {
            get { return officeID; }
            set { this.officeID = value; }
        }

I made changes to the fields\list\access\default.vm which seem to work fine.  I see my changes there.
0
Ady
Telerik team
answered on 17 Sep 2009, 11:54 AM
Hello Aaron Kowall,

The Reverse mapping wizard picks the first template (.vm) file if more than 1 exists in the template directory. Can you please remove the extra file or rename it so that the right one is alphabetically the first?
 

Regards,

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
Development (API, general questions)
Asked by
Aaron Kowall
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Aaron Kowall
Top achievements
Rank 1
Ady
Telerik team
Share this question
or