Sometimes in order to write less code it is used to have SQL server set fields like date, time and ID on insert by setting the default value for fields to GETDATE()
or NEWID()
.
In such cases Auto Generated Value property of those fields in entity classes should be set to true.
This way you do not need to set values in code (preventing energy consumption!!!) and never see that exception.