Hi,I need conditionally use .Include,tried something like that:
var res = db.HT_REZ.AsQueryable(); if (condition) { res = res.Include(r => r.CF) .Include(r => r.HT_ROOM) .Include(r => r.HT_GRUPS); } res = await res.FirstOrDefaultAsync(r => r.ID == id);but got: Cannot implicitly convert type 'Rez.Models.HT_REZ' to 'System.Linq.IQueryable<Rez.Models.HT_REZ>'
If I add the conversion re = (IQueryable<HT_REZ>)await re.FirstOrDefaultAsync(r => r.ID == id) then it doesn't recognize properties
if (re.ID >100): 'IQueryable<HT_REZ>' does not contain a definition for 'ID'
is there any working solution?
thanks