Example #1
0
            public async Task <Unit> Handle(CrearInstructor request, CancellationToken cancellationToken)
            {
                InstructorModel datos = new InstructorModel
                {
                    Nombre    = request.Nombre,
                    Apellidos = request.Apellidos,
                    Grado     = request.Grado
                };
                var resultado = await instructor.Crear(datos);

                if (resultado > 0)
                {
                    return(Unit.Value);
                }

                throw new Exception("No se pudo insertar el Instructor");
            }