C# Entity Framework 4.1 Lambda Include - only select specific included values

前端 未结 3 762
北恋
北恋 2021-01-22 00:47

I\'m doing a lambda select on EF4.1, including another related DBSet in my current statement.

 return dbEntity.GameTypes.Include(a => a.Draws)
                        


        
3条回答
  •  抹茶落季
    2021-01-22 01:00

    From MSDN for DbExtensions.Include().

    The path expression must be composed of simple property access expressions together with calls to Select in order to compose additional includes after including a collection property.

    So I don't think using Where() is allowed. I'm not sure if you can do any filtering when it comes to Include().

提交回复
热议问题