Virtual fields with FieldAlias attribute

4 posts, 0 answers
  1. Pål
    Pål avatar
    53 posts
    Member since:
    Sep 2012

    Posted 11 Jan 2009 Link to this post

    Hi.

    I have a persistent class with a virtual persistent property like this:

    public class Foo {

        private bool m_IsFoobar;

        [FieldAlias("m_IsFoobar")]
        public virtual bool IsFoobar {
            get {return m_IsFoobar;}
        }
    }

    Works like a charm! But when I extend the class and override the property, something bad happens:

    public class Bar {

        public override IsFoobar {
            get {return true;}
        }
    }

    I get an exception on build telling me that the field alias I declared in "Foo" reffers to a field which cannot be found...

    It seems it parses through the derived class and picks up the field attribute, but failes to recognise that it actually belongs to the base class, and so looks for m_IsFoobar field in the wrong class.

    Any thoughts on this? Bug or feature?

    Best regards

    Pål Økern
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 13 Jan 2009 Link to this post

    Hi Pål,

    This is a bug on our side. It is scheduled for fixing. As soon as we have more on the topic and it is resolved we can notify you. Thanks for the cooperation. Your Telerik points were updated.

    Sincerely yours,
    Alexander
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 14 Jan 2009 Link to this post

    Hi Pål,
    We have fixed your problem, the fix will be available in the next patch. We try to ship a new version this week or early next.

    Greetings,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Pål
    Pål avatar
    53 posts
    Member since:
    Sep 2012

    Posted 14 Jan 2009 Link to this post

    Thanks again. :-)

    Pål
Back to Top