这是有效的代码;
IQueryable<Product> productQuery = ctx.Set<Product>().Where(p => p.Id == id).(Include"Contexts.AdditionalProperties.Field");
但你知道,即使我们在 "Contexts.AdditionalProperties.Field" 的字符串语句中犯了错误,它也不会产生编译时错误。
我想编写下面的代码;
IQueryable<Product> productQuery = ctx.Set<Product>().Where(p => p.Id == id).Include(p => p.Contexts);
但是上述语句不能为定义AdditionalProperties和Field提供机会。
我们应该怎么办?
我想写多个include来构建查询。
谢谢。