Esempio n. 1
0
 public async Task <ICollection <GeneratedService.ResponseProduct> > GetProductsAsync(
     [Service] ProductClient service, CancellationToken cancellationToken, int?companyId, int?categoryId)
 {
     if (companyId != null && categoryId != null)
     {
         return(await service.GetProductsByCategoryIdAndCompanyIdAsync(categoryId, companyId, cancellationToken));
     }
     if (companyId != null)
     {
         return(await service.GetProductsByCompanyIdAsync(companyId, cancellationToken));
     }
     if (categoryId != null)
     {
         return(await service.GetProductsByCategoryIdAsync(categoryId, cancellationToken));
     }
     return(await service.GetAllProductsAsync(cancellationToken));
 }