Badges.Areas.Admin.Controllers.InstructorController.Delete C# (CSharp) Method

Delete() private method

private Delete ( System.Guid id, Instructor instructor ) : System.Web.Mvc.ActionResult
id System.Guid
instructor Instructor
return System.Web.Mvc.ActionResult
        public ActionResult Delete(Guid id, Instructor instructor)
        {
            var instructorToDelete = RepositoryFactory.InstructorRepository.GetNullableById(id);

            if (instructorToDelete == null) return RedirectToAction("Index");

            RepositoryFactory.InstructorRepository.Remove(instructorToDelete);

            Message = "Instructor Removed Successfully";

            return RedirectToAction("Index");
        }