public InstructorResult GetInstructorCourses(int courseId, DateTime startDate, DateTime endDate)
        {
            InstructorResult result = new InstructorResult();

            try
            {
                result.Data    = _instructorRepository.GetInstructorCourses(courseId, startDate, endDate);
                result.success = true;
            }
            catch (Exception ex)
            {
                result.success = false;
                result.message = "Error obteniendo los instructores.";
                _logger.LogError(result.message, ex);
            }
            return(result);
        }
        public async Task <InstructorResult> AddInstructor(Instructor instructor)
        {
            InstructorResult result = new InstructorResult();

            try
            {
                await _instructorRepository.AddInstructor(instructor);

                result.success = true;
                result.message = "Instructor agregado correctamente.";
            }
            catch (Exception ex)
            {
                result.success = false;
                result.message = "Error agregando el instructor.";
                _logger.LogError(result.message, ex);
            }

            return(result);
        }