.net - How to ignore a particular field from an Entity model upon insert? -
we have field in our sql server database table autogenerated sql server, field called createdtime.
we have mapped whole database table our datamodel in entity framework, field createdtime.
when insert new row in database, via entity framework, not provide value createdtime.
this causes insert fail error:
sqldatetime overflow. must between 1/1/1753 12:00:00 , 12/31/9999 11:59:59 pm
so question is: there way to exclude particular field in entity datamodel in entity framework insert statement? not above error?
we keep field createdtime in entity model, because might want access later.
i found simple solution problem on thread:
there fernando soto writes:
"if go edm designer click on field in table auto-generated database, right click on , select properties , @ properties windows click on storegeneratedpattern , set value computed, believe give looking for."
the above solution super quick , easy , seems work.
also thank contributions guys, above solution seems job.
Comments
Post a Comment