// POST: api/WebApiClient public IHttpActionResult Post([FromBody] ClientApiViewModel CVM) { if (!ModelState.IsValid) { return(BadRequest("Invalid data.")); } Client C = new Client(); C.Clientid = CVM.ClientID; C.Nom = CVM.Nom; C.Prenom = CVM.Prenom; C.Email = CVM.Email; C.PhoneNumber = CVM.NumeroTel; CS.Add(C); CS.Commit(); return(Ok(C)); }