コード例 #1
0
ファイル: Nuevo.cs プロジェクト: SergioEspinozaG/VaxiApp
            public async Task <Unit> Handle(Ejecuta request, CancellationToken cancellationToken)
            {
                var instructor = new InstructorModel {
                    Nombre    = request.Nombre,
                    Apellidos = request.Apellidos,
                    Titulo    = request.Titulo,
                };

                var resultado = await _instructorRepository.NuevoInstructor(instructor);

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

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