public async Task <ActionResult> Delete(Note model) { await _notesService.DeleteAsync(model); if (User.IsInRole(Constants.RoleInstructor)) { return(RedirectToRoute("InstructorDetails", new { id = model.CourseId })); } else { return(RedirectToRoute("StudentDetails", new { id = model.CourseId })); } }