public async Task <ActionResult <LineItem> > GetAllLineItems() { try { return(Ok(await _lineItemRepository.GetAllLineItems())); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from database")); } }
public HttpResponseMessage GetLineItems() { var lineItems = _lineItemRepository.GetAllLineItems() as List <LineItem>; return(Request.CreateResponse(HttpStatusCode.OK, lineItems)); }