I’m trying to use WhereBulkContains with a navigation property like in the code snippet below
return this
.repository.Tasks.AsNoTracking()
.Include(t => t.Resource)
.WhereBulkContains(resourceMappingIds, t => t.Resource.MappingId)
However, it throws An error occurred while executing the command definition. See the inner exception for details. ---> System.Exception: Oops! The following property names 'Resource' has not been found in the entity type 'Task'. at Z.EntityFramework.Plus.WhereBulkContainsBuilder
1.(List1 , LambdaExpression , List
1 , List1 , SchemaEntityType )
If I change it to normal EF contains, the function works as expected. It looks like .Include is ignored by WhereBulkContains
, what’s the correct way for querying on navigation property in this situation?
I tried using ToSelfHierarchyList
, however as we’re later creating a lookup I require an IQueryable to be returned.
Paula B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.