found default value bug

Thread is closed for posting
2 posts, 0 answers
  1. Smail
    Smail avatar
    10 posts
    Member since:
    Apr 2013

    Posted 12 Apr 2013 Link to this post

    I'm writing in relation to the newly released feature in the Telerik OpenAccess ORM - the database default value support.
    When generating model entities from MSSQL 2005 and MySQL 5.5 the default values for fields do not get set in the generated models.
    Every property has its private backing field un-initialised (private int Status;) when it should read the default value for that field (private int Status = 1;)
  2. PetarP
    PetarP avatar
    754 posts

    Posted 15 Apr 2013 Link to this post

    Hi Smail,

     I am afraid that this is the way that OpenAccess is supposed to be working. We are intentionally not generating the default values in your code but we are rather depending on them to be generated by the backend. In order to achieve that we are requiring that each clr member that is supposed to have a default value be nullable. Each time you have a null in that member and in the same time the member is marked as having a default value we are ommiting it from the SQL insert query and thus allowing the server to generate that value for us.
    Additional information regarding the default values can be found in our online documentation here.

    the Telerik team
    Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
Back to Top