public static IMartenQueryable <T> ThenInclude <T>(IMartenQueryable <T> queryable, string include, IIncludeMapper <T> mapper) { queryable = include switch { "practices" => queryable.ThenIncludeInverted <Practitioner, Practice, string>(x => x.HealthFacility, mapper.Practices), "healthServices" => queryable.ThenIncludeInverted <Practitioner, HealthService, string>(x => x.HealthFacilityId, mapper.HealthServices), _ => queryable }; return(queryable); }
public static IMartenQueryable <T> ThenInclude <T>(IMartenQueryable <T> queryable, string include, IIncludeMapper <T> mapper) { queryable = include switch { "healthFacility" => queryable.ThenInclude <Practice, HealthFacility, string>(x => x.HealthFacility, mapper.HealthFacilities), "practitioner" => queryable.ThenInclude <Practice, Practitioner, string>(x => x.Practitioner, mapper.Practitioners), _ => queryable }; return(queryable); }