Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
C#
var cert = _context.Certificates
             .Include(c => c.Staff)
             .ThenInclude(c => c.Department.Abbr.Contains("cs"))
             .Where(c => (int)c.CertificateType == 1)
             .AsNoTracking();

ThenInclude gives error as the expression should represent a property for access in .net core.

What I have tried:

The above code does not give syntax error. But while running it does not work.
Posted
Updated 8-Jul-18 20:49pm
v2
Comments
Mehdi Gholam 9-Jul-18 2:29am    
"Does not work", is not helpful for anyone. Try to explain how it is not working, what exceptions you are getting etc.

1 solution

You should Google you error message whenever it is not know for you...
It seems you just hit a known issue here:
Support filtered Include · Issue #1833 · aspnet/EntityFrameworkCore · GitHub[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900