Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        public void UpdateInstructor(Instructor entity)
        {
            InstructorRepository instructorRepository = new InstructorRepository();

            instructorRepository.Update(entity);
        }
Ejemplo n.º 3
0
 public void Update(Instructor inst)
 {
     repository.Update(inst);
 }