public IActionResult Delete(int id) { try { UserSessionContext userSession = new UserSessionContext(this.HttpContext); LessonBusiness lessonManager = new LessonBusiness(DbContext); lessonManager.DeleteLesson(id, userSession.CurrentUser); this.ShowAlert("The lesson was successfully deleted.", "sprite-delete16"); } catch (Exception ex) { this.AddError(ex.Message); } return(RedirectToAction("Index", new { pageAction = Enumerations.PageAction.Search })); }