コード例 #1
0
        public void CrearCurso(CrearMatriculaRequest request, string expected)
        {
            _service = new CrearMatriculaService(_unitOfWork);
            var response = _service.Ejecutar(request);

            Assert.AreEqual(expected, response.Message);
        }
コード例 #2
0
        public async Task <IActionResult> CreateMatricula([FromBody] int idPreMatricula)
        {
            _service = new CrearMatriculaService(_unitOfWork);
            request  = new CrearMatriculaRequest();
            request.IdPreMatricula = idPreMatricula;
            var rta = _service.Ejecutar(request);

            if (rta.isOk())
            {
                await _context.SaveChangesAsync();

                return(CreatedAtAction("GetUsuario", new { IdPrematricula = request.IdPreMatricula }, request));
            }
            return(BadRequest(rta.Message));
        }