public async Task <IActionResult> PutClientPar([FromRoute] int id, [FromBody] ClientPar clientPar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != clientPar.Idclpar) { return(BadRequest()); } _context.Entry(clientPar).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientParExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
/* * internal bool blaklist(NonAddresseS2 nonAddresseS) * { * // this.TGs.emplacement.Contains(x => x.); * return TGs.emplacement.Contains(new TG.Doubleint { rayon = nonAddresseS.Alle, trave = nonAddresseS.Trave }); * }*/ private Parameters() { this.prod = new Prod(); this.TGs = new TG(); this.ps = new LisSecteur(); this.emag = new Emag(); this.client = new ClientPar(); }
public async Task <IActionResult> PostClientPar([FromBody] ClientPar clientPar) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ClientPars.Add(clientPar); await _context.SaveChangesAsync(); return(CreatedAtAction("GetClientPar", new { id = clientPar.Idclpar }, clientPar)); }