public async Task <List <Product> > GetProductsForExportToBalance(FilterProductsToBalance filterProductsToBalance) { var query = _entities.Select(x => x); if (filterProductsToBalance.TypeOfSearchProductsToBalance == TypeOfSearchProductsToBalance.OnlyModified) { query = query.Where(c => c.ExportToBalance == true); } return(await query.ToListAsync()); }
public async Task <IActionResult> GetProductsForExportToBalance([FromBody] FilterProductsToBalance filterProductsToBalance) { try { var result = await(_service as IProductService).GetProductsForExportToBalance(filterProductsToBalance); return(Ok(result)); } catch (NotSupportedException e) { return(SendBadRequest(e.Message.Split('|'))); } catch (Exception e) { return(SendBadRequest(e)); } }
public Task <List <Product> > GetProductsForExportToBalance(FilterProductsToBalance filterProductsToBalance) { return((_repository as IProductRepository).GetProductsForExportToBalance(filterProductsToBalance)); }