예제 #1
0
        public async Task <int> CreatePreguntaAsync(PreguntaToCreateVM preguntaToCreateVM)
        {
            var entity = mapper.Map <PreguntaEntity>(preguntaToCreateVM);
            var id     = await leccionRepository.CreatePreguntaAsync(entity);

            return(id);
        }
예제 #2
0
        public async Task <IActionResult> CreatePreguntaAsync(int idLeccion, [FromBody] PreguntaToCreateVM preguntaToCreateVM)
        {
            preguntaToCreateVM.IdLeccion = idLeccion;
            var result = await leccionService.CreatePreguntaAsync(preguntaToCreateVM);

            return(Ok(result));
        }