Using .NET Entity Framework 6 I need to filter the elements of an included virtual collection. What I mean is easily explained with the following code:
context.MyEntity.Include( navigationPropertyCollection => navigationPropertyCollection.Where( np => np.IsActive() ) )
the code code is just an example, to say from MyEntity I want include only active elements of navigationPropertyCollection.
Is there a smart way to do it?
msdn reference
you could try this by anonymous projection
Similar Answer in Stack