public ActionResult Index(string id = "") { if (!Context.Routes.Any(x => x.Shortcut == id && x.Active)) { var data = new IndexViewData(); var mainwall = _wallService.GetMainWall(); data.MainWall = mainwall.ToList(); data.Masterclasses = _masterclassService.GetNearestMasterclasses(); return(View(data)); } var elem = Context.Routes .Include(x => x.Raiting) .Single(x => x.Shortcut == id && x.Active); this.SetRoute(elem); elem.AddView(); Context.SaveChanges(); return(View(elem)); }