When using Linq-to-SQL, adding a column to an existing table, and setting a default value on that new column, it seems that Linq to SQL ignores the default value. Has anyon
I have now definitively fixed this by using an example from this blog.
partial void OnCreated() {
if (this.DateTimeCreated == null) {
this.DateTimeCreated = DateTime.Now;
}
}
I needed to pass this into a partial datacontext class, as the default one is automatically overwritten every time you change something in the dbml.