public async Task <IHttpActionResult> PutProfessor(ProfessorUpdateViewModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var professor = await _professors.Find(model.Id); professor.SSN = model.SSN; professor.Name = model.Name; professor.UserName = professor.Email = model.Email; professor.PhoneNumber = model.PhoneNumber; professor.DepartmentId = model.DepartmentId; await _professors.Update(professor); } catch (DbUpdateConcurrencyException) { if (!_professors.Exists(model.Id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }