Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }