public Remorqueur PutRemorqueur(string matricule, Remorqueur Remorqueur) { if (!ModelState.IsValid) { new Remorqueur(); } if (matricule != Remorqueur.matricule) { new Remorqueur(); } db.Entry(Remorqueur).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { } return Remorqueur; }
public bool PostRemorqueurLogi(Remorqueur Remorqueur) { if (!ModelState.IsValid) { return false; } return db.Remorqueurs.Where(c => c.matricule.Equals(Remorqueur.matricule) && c.password.Equals(Remorqueur.password)).Count() > 0; }
// POST api/Remorqueur public async Task<Remorqueur> Post(Remorqueur Remorqueur) { if (!ModelState.IsValid) { return null; } db.Remorqueurs.Add(Remorqueur); await db.SaveChangesAsync(); return Remorqueur; }