I have an SQL Server DB with a table with these fields:
bit
with the default value 1, NOT NULL
.smalldatetime
Linq-To-Sql generated classes do not pick up the Default Value Constriants.
Maybe in the future, but the issue is constraints aren't always simple values, they can also be scalar functions like GetDate()
, so linq would somehow have to know how to translate those. In short, it doesn't even try. It's also a very database-specific type of thing.
The issue you are having is described at length in CodeProject - Setting Default Values for LINQ Bound Data