How do you include just a single entity per "main" entity in a query where the navigational property is a collection?
await _database.Table1
.AsQueryable()
.Include(t1 => t1.Table2.Where(t2 => t2.Id == t1.SingleTable2Id))
.FirstOrDefaultAsync();
The above doesn't seem to work. I get the following exception:
could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.