public async Task <IActionResult> PutAdministrador(int id, Administrador administrador) { if (id != administrador.Id) { return(BadRequest()); } _context.Entry(administrador).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdministradorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCliente(int id, Cliente cliente) { if (id != cliente.Id) { return(BadRequest()); } _context.Entry(cliente).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Putinterest(int id, interest interest) { if (id != interest.ID) { return(BadRequest()); } _context.Entry(interest).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!interestExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task<IActionResult> Putuser(int id, user user) { if (id != user.ID) { return BadRequest(); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!userExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }
public ActionResult Edit([Bind(Include = "Id,Nome,LoginUsuario,Senha,Email,Pefil,DataContratacao")] Usuario usuario) { if (ModelState.IsValid) { db.Entry(usuario).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(usuario)); }
public async Task <ActionResult <Mesaj> > GetMesaj(int id) { var mesaj = await _context.Mesajs.FindAsync(id); //Console.WriteLine(mesajs); if (mesaj.isRead == 1) { mesaj.isRead = 0; _context.Entry(mesaj).State = EntityState.Modified; await _context.SaveChangesAsync(); } return(mesaj); }
public Personne Update(Personne personne) { context.Entry(personne).State = EntityState.Modified; Save(); return(personne); }
public Voiture Update(Voiture voiture) { context.Entry(voiture).State = EntityState.Modified; Save(); return(voiture); }