D
D
DavyJohnes2014-02-26 08:11:57
MySQL
DavyJohnes, 2014-02-26 08:11:57

[Entity Framework 6] MySQL and Default Value?

Hello! There is an asp.net mvc application with an EF6 data model that is created from an existing MySQL database. Some tables have fields with "NOT NULL" and "Default value" attributes. Thus, if this field is specified as null during insertion, then an error occurs, but if this field is not specified at all during insertion, the value is taken from the default value. How to make EF act in the same way? Those. when saving a new record, do not add a field equal to null to the resulting query, or use the default value in advance?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question