An error occurred while saving entities that do not expose foreign key properties for their relationships

后端 未结 15 1410
难免孤独
难免孤独 2020-12-08 02:43

I have a simply code in Entity Framework 4.1 code first:

PasmISOContext db = new PasmISOContext();
var user = new User();
user.CreationDate = Da         


        
15条回答
  •  甜味超标
    2020-12-08 03:10

    For those of you who would still have this error with all keys properly defined, have a look at your entities and make sure you don't leave a datetime field with a null value.

提交回复
热议问题