public IActionResult Edit(int id) { var uredjaj = _uredjajService.GetById(id); UredjajEditDto noviUredjaj = new UredjajEditDto(); noviUredjaj.Id = uredjaj.Id; noviUredjaj.Name = uredjaj.Name; return(View(noviUredjaj)); }
public void Update(int id, UredjajEditDto input) { var uredjaj = _uredjajRepository.Get(id); if (uredjaj == null) { throw new UserFriendlyException("Nepostojeci uredjaj"); } ObjectMapper.Map(input, uredjaj); }
public IActionResult Edit(int id, UredjajEditDto input) { _uredjajService.Update(id, input); return(RedirectToAction("GetAll")); }