Field Not Set

2 posts, 0 answers
  1. Dennis
    Dennis avatar
    12 posts
    Member since:
    Oct 2012

    Posted 14 Nov 2013 Link to this post


    I have this class declaration.  I also added the HasFieldName("_num") on the Number property.  When I read the contents from the database, the value of _num is always zero, even if Number property is not zero.  Why is it not synchornized?

    class Test
      public Number {
        get { return _num; }
        set { _num = value; }
      private int _num = 0;
  2. Boris Georgiev
    Boris Georgiev avatar
    190 posts

    Posted 19 Nov 2013 Link to this post

    Hi Dennis,

    The field values are populated lazily when one of the properties is accessed. Telerik OpenAccess ORM has this behavior for performance optimization. If you want to populate the fields with the actual values you should invoke the OpenAccessEnhancedPreSerialize method on every entity loaded in the memory:
    To cast the object to PersistenceCapable you should use: Telerik.OpenAccess.SPI.dataobjects namespace.

    If any other questions arise, do not hesitate to contact us again.

    Boris Georgiev
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
  3. DevCraft banner
Back to Top