public ViewResult Details(int commodityGroupId) { var getCommidityGroupResult = mc_CommodityRepository.GetCommodityGroup(commodityGroupId); var commodityGroup = getCommidityGroupResult.Result as CommodityGroup; return(View(commodityGroup)); }
public async Task <ActionResult <CommodityGroup> > GetCommodityGroup(int commodityGroupId) { try { var commodityGroup = await mc_CommodityRepository.GetCommodityGroup(commodityGroupId); if (commodityGroup == null) { return(NotFound()); } return(Ok(commodityGroup)); } catch (Exception exception) { string message = "Error occurred in CommodityController.GetCommodityGroup" + Environment.NewLine; message += exception.Message; return(StatusCode(StatusCodes.Status500InternalServerError, message)); } }