I have the following classes:
public class Configuration
{
public long Id {get;set;}
public string Name {get;set;}
public Expression Criteria {get;set;}
}
public class Expression
{
public long Id {get;set;}
public string Value {get;set;}
public ICollection<Parameter> Parameters {get;set;}
}
public class Parameter
{
public long Id {get;set;}
public MyType Type {get;set;}
}
public class MyType
{
public long Id {get;set;}
public string Name {get;set;}
}
I am trying to eagerly load the entire configuration object using:
dbContext.Configurations.Select(i => i.Criteria).Include(i => i.Parameters.Select(j => j.Type)).ToList()
I am however getting null for the Parameters property and it is not getting fetched.
What am I doing wrong.