Why EF navigation property return null?

后端 未结 5 643
执笔经年
执笔经年 2020-12-17 16:12

I have two model 1)

public class Indicator
{
    public long ID { get; set; }
    public string Name { get; set; }
    public int MaxPoint { get; set; }
             


        
5条回答
  •  臣服心动
    2020-12-17 16:41

    Same behavior, but different root cause than selected answer:

    Navigation property can also be null if you turned off myContext.Configuration.AutoDetectChangesEnabled

    Very obvious, but this got me when I was implementing some performance improvments.

提交回复
热议问题