In my database there's a datetime column "Created" with default value getutcdate()
. I would like my EF datacontext to generate an insert query that doesn't set this column, and fetch the resulting value. Is there a way to do this?
I tried setting StoreGeneratedPattern to either None, Identity or Computed, I get an exception that DateTime can't be converted to datetime2 (meaning it's trying to insert 0:00 at 0-0-0)
How do I set up my edmx to allow creating objects without specifying the initial Created value?