public IActionResult Edit(int id) { var storeowner = _RadiusMasterServices.GetById(id); if (storeowner == null) { return(NotFound()); } var model = new RadiusMasterEditViewModel() { id = storeowner.id, name = storeowner.name, }; return(View(model)); }
public async Task <IActionResult> Edit(RadiusMasterEditViewModel model) { if (ModelState.IsValid) { var storeobj = _RadiusMasterServices.GetById(model.id); if (storeobj == null) { return(NotFound()); } storeobj.id = model.id; storeobj.name = model.name; await _RadiusMasterServices.UpdateAsync(storeobj); TempData["success"] = "Record Updated successfully"; return(RedirectToAction(nameof(Index))); } else { return(View()); } }