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

后端 未结 15 1417
难免孤独
难免孤独 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 02:51

    In my case, the problem was that I renamed a column improperly, so the migration made two columns, one called "TeamId" and one called "TeamID". C# cares, SQL doesn't.

提交回复
热议问题