.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:

http://social.msdn.microsoft.com/forums/en-us/adodotnetentityframework/thread/7db14342-b259-4973-ac09-93e183ae48bb

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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -