且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实体框架Linq等于值或为null

更新时间:2023-11-29 09:33:46

映射错误.从HasKey映射中删除了LocationId.

The mapping was wrong. Removed LocationId from the HasKey mapping.

好像LINQ将某个属性视为键的一部分,它将假定它是不可为空的,而该属性是否为可为null(int?)

Seems like if LINQ sees a property as part of a key it will assume it is non-nullable, does not matter if the property is nullable (int?)