public async Task <IActionResult> DeleteAsync(int lessonId)
        {
            var result = await _lessonService.DeleteAsync(lessonId);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }
            var lessonResource = _mapper.Map <Lesson, LessonResource>(result.Resource);

            return(Ok(lessonResource));
        }
Beispiel #2
0
        public async Task <IActionResult> DeleteConfirmed(long id)
        {
            await _lessonService.DeleteAsync(id);

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> Delete(int id)
        {
            await _lessonService.DeleteAsync(id);

            return(NoContent());
        }
        public async Task <IActionResult> Delete(int id)
        {
            await _lessonService.DeleteAsync(id);

            return(RedirectToAction("GetAll", "Lesson"));
        }