public IHttpActionResult PutClient(int id, Client client) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != client.ClientID) { return BadRequest(); } db.Entry(client).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostClient(Client client) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Clients.Add(client); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = client.ClientID }, client); }
public Candidate(string _name, string _firstApe, string _secondApe, string _firstEmail, int _firstTelephone, int _secondTelephone, string _secondEmail, bool _isHide, Client _client, User _seller) { name = _name; firstApe = _firstApe; secondApe = _secondApe; firstEmail = _firstEmail; firstTelephone = _firstTelephone; secondTelephone = _secondTelephone; secondEmail = _secondEmail; isHide = _isHide; client = _client; seller = _seller; calls = new HashSet<CandidateCall>(); attributeInfoCandidate = new HashSet<AttributeInfoCandidate>(); }