public async Task <ActionResult> Put(int id, [FromBody] InstructorDto instructor) { Instructor dbInstructor = await InstructorRepository.GetAsync(id); if (instructor == null) { return(BadRequest()); } Mapper.Map(instructor, dbInstructor); if (!InstructorRepository.Update(dbInstructor)) { throw new Exception($"Updating a instructor {id} failed on save."); } return(NoContent()); }
public void UpdateInstructor(Instructor entity) { InstructorRepository instructorRepository = new InstructorRepository(); instructorRepository.Update(entity); }
public void Update(Instructor inst) { repository.Update(inst); }