public IActionResult GetOutlet(int Id) { var outlet = _outletData.GetOutlet(Id); if (outlet != null) { return(Ok(outlet)); } return(NotFound($"Outlet with id: {Id} was not found! ")); }
// GET: Admin/Outlets/Edit/5 public async Task <IActionResult> Edit(long?id) { if (id == null) { return(NotFound()); } var outlet = await _outletService.GetOutlet(id.Value); if (outlet == null) { return(NotFound()); } var outletViewModel = _mapper.Map <OutletCreateViewModel>(outlet); return(View(outletViewModel)); }