public Task <List <ContainerResource> > GetDeliveredContainersAsync(ContainerParams queryParams) => Collection .Find(Builders <Container> .Filter.Empty) .Page(queryParams) .SortByDescending(queryParams.OrderByExpression) .Project(c => c.ToContainerResource()) .ToListAsync();
public Task <List <ContainerResource> > GetLoadedContainersAsync (Guid supplierIdentity, ContainerParams queryParams) => Collection .Find(s => s.Identity == supplierIdentity) .Project(s => s.LoadedContainers .Page(queryParams) .OrderByDescending(queryParams.OrderByExpression.Compile()) .Select(c => c.ToContainerResource()) .ToList()) .SingleOrDefaultAsync();
public Task <List <ContainerResource> > GetAcceptedContainersAsync (Guid inventoryIdentity, ContainerParams queryParams) => Collection .Find(i => i.Identity == inventoryIdentity) .Project(i => i.AcceptedContainers .Page(queryParams) .OrderByDescending(queryParams.OrderByExpression.Compile()) .Select(c => c.ToContainerResource()) .ToList()) .SingleOrDefaultAsync();
public async Task <ActionResult <List <ContainerResource> > > GetLoadedContainers( Guid supplierIdentity, [FromQuery] ContainerParams queryParams, [FromServices] SupplierQuery supplierQuery) { List <ContainerResource> containers = await supplierQuery .GetLoadedContainersAsync(supplierIdentity, queryParams); if (containers is null) { return(NotFound()); } return(containers); }