public async Task <IActionResult> Get() { try { var data = await _productQueries.GetProducts(); return(Ok(new ApiOkResponse(data, data.Count()))); } catch (Exception ex) { _logger.LogCritical(ex, "Error on Get Customers"); return(BadRequest(new ApiBadRequestResponse(500, "Something Wrong"))); } }
public IEnumerable <ProductModel> GetProducts() { _logger.LogDebug($"Request {nameof(GetProducts)}"); return(_queries.GetProducts().Select(s => new ProductModel(s))); }