public IActionResult Get(Int32 Id) { try { OrderProvider Provider = new OrderProvider(OrderDB); Order FoundOrder = Provider.Get(Id); if (FoundOrder == null) { return(NotFound()); } return(new ObjectResult(FoundOrder)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult Get(string criteriaId) { var viewModel = new GenericModel <OrderModel>(); try { var data = OrderProvider.Get(Helpers.GetAuthenticator(), criteriaId); viewModel.Data = data; viewModel.ResultMessage = data != null ? string.Empty : string.Format(Resources.DataNotFound, criteriaId); } catch (Exception ex) { viewModel.ErrorMessage = ex.GetBaseException().Message; } viewModel.Criteria.Add("criteriaId", criteriaId); return(View("Index", viewModel)); }