public async Task <IHttpActionResult> GetProducts([FromUri] int start = 0, [FromUri] int amount = 100) { if (start < 0) { return(BadRequest($"start")); } if (amount < 0) { return(BadRequest("end")); } var products = await _productService.GetProductsAsync(start, amount); return(Ok(products)); }
public async Task <IHttpActionResult> GetProducts([FromUri] int start = 0, [FromUri] int amount = 100) { if (start < 0) { return(BadRequest("start")); } if (amount < 0) { return(BadRequest("end")); } try { var products = await _productService.GetProductsAsync(start, amount); return(Ok(products)); } catch (Exception) { return(this.InternalServerError()); } }