YouConf.Controllers.ConferenceController.DeleteConfirm C# (CSharp) Метод

DeleteConfirm() приватный Метод

private DeleteConfirm ( string hashTag ) : System.Web.Mvc.ActionResult
hashTag string
Результат System.Web.Mvc.ActionResult
        public ActionResult DeleteConfirm(string hashTag)
        {
            var conference = YouConfDbContext.Conferences
                .FirstOrDefault(x => x.HashTag == hashTag);

            var id = conference.Id;

            if (conference == null)
            {
                return HttpNotFound();
            }
            if (!IsCurrentUserAuthorizedToAdministerConference(conference))
            {
                return HttpUnauthorized();
            }

            conference.Speakers.ToList().ForEach(x => x.Presentations.Clear());
            YouConfDbContext.Conferences.Remove(conference);
            YouConfDbContext.SaveChanges();

            UpdateConferenceInSolrIndex(conference.Id, Common.Messaging.SolrIndexAction.Delete);

            return RedirectToAction("All");
        }