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

4 posts, 0 answers
  1. Aaron Kowall
    Aaron Kowall avatar
    2 posts
    Member since:
    Jun 2009

    Posted 14 Sep 2009 Link to this post

    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)");

    }

    }

    }

  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 14 Sep 2009 Link to this post

    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.
  3. DevCraft banner
  4. Aaron Kowall
    Aaron Kowall avatar
    2 posts
    Member since:
    Jun 2009

    Posted 14 Sep 2009 Link to this post

    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.
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 17 Sep 2009 Link to this post

    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.
Back to Top