Ejemplo n.º 1
0
        public async Task <int> AddTeacher(TeacherAddDTO teacherAddDTO)
        {
            var teacher = _mapper.Map <TeacherAddDTO, Teacher>(teacherAddDTO);
            await _unitOfWork.Teachers.AddAsync(teacher);

            return(await _unitOfWork.SaveAsync());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <string> > AddTeacher(TeacherAddDTO teacherAddDTO)
        {
            var result = await _teacherService.AddTeacher(teacherAddDTO);

            return(result > 0 ? StatusCode(StatusCodes.Status201Created) : BadRequest());
        }