public async Task Update() { KupciUpdateRequest updateRequest = new KupciUpdateRequest(); KupciVM kupciVM = new KupciVM(); updateRequest.Email = UrediEmail; updateRequest.Ime = UrediIme; updateRequest.Prezime = UrediPrezime; kupciVM = await _kupci.Update <KupciVM>(Global.PrijavljeniKupac.KupacId, updateRequest); if (kupciVM != null) { ProfilUpdatean = true; } }
public KupciVM Update(int id, KupciUpdateRequest request) { var kupacUpdate = _context.Kupci.Find(id); KupciVM kupciVM = new KupciVM(); if (kupacUpdate != null && request != null) { kupacUpdate.Ime = request.Ime; kupacUpdate.Prezime = request.Prezime; kupacUpdate.Email = request.Email; _context.SaveChanges(); } kupciVM = _mapper.Map <KupciVM>(kupacUpdate); return(kupciVM); }
public KupciVM Update(int id, KupciUpdateRequest request) { return(_service.Update(id, request)); }