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

found default value bug

1 Answer 37 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Smail
Top achievements
Rank 1
Smail asked on 12 Apr 2013, 02:08 PM
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;)

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 15 Apr 2013, 03:17 PM
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.

Greetings,
Petar
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
Tags
Design Time (Visual Designer & Tools)
Asked by
Smail
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or