public IResult <IQueryable <ILocationReturn> > GetProductionLines() { var predicate = LocationPredicates.ProductionLinesFilter; var selector = LocationProjectors.SelectLocation(); var query = _productionUnitOfWork.LocationRepository.Filter(predicate).AsExpandable().Select(selector); return(new SuccessResult <IQueryable <ILocationReturn> >(query)); }
public IResult <IEnumerable <ILocationGroupNameReturn> > GetFacilityLocationGroups(string facilityKey) { var facilityKeyResult = KeyParserHelper.ParseResult <IFacilityKey>(facilityKey); if (!facilityKeyResult.Success) { return(facilityKeyResult.ConvertTo <IEnumerable <ILocationGroupNameReturn> >()); } var locations = _inventoryUnitOfWork.LocationRepository .Filter(LocationPredicates.ByFacilityKey(facilityKeyResult.ResultingObject)) .Select(LocationProjectors.SelectGroupName()).ToList() .DistinctBy(l => l.LocationGroupName).ToList(); return(new SuccessResult <IEnumerable <ILocationGroupNameReturn> >(locations)); }