Default value from SQL Server table’s column does not appear in entity.
Is it normal behavior?
I have tried to figure it out but with no result.
Thanks for any help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Entity Framework provides an explicit value for each property. In SQL you can write a query that inserts a value into
[Field1]and leave[Field2]and[Field3]blank, and they will use the database default. But since Entity Framework generates the query based on the properties defined on the entity, all columns will always be given a value, so if you want to provide a default value, it will need to be set in the designer, I don’t think it gets automatically picked up when the entity model is created.