Beispiel #1
0
        public IHttpActionResult UpdateResume(string id, CandidateResume candidateResume)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            if (id != candidateResume.CandidateId)
            {
                return(BadRequest("ID does not match."));
            }

            Models.Candidate cm = new Candidate();
            cm.Entry(candidateResume).State = EntityState.Modified;

            try
            {
                cm.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }
            return(StatusCode(HttpStatusCode.NoContent));
        }