public ActionResult Index(long CategoryId = 0) { var model = new SurveyIndexViewModel(_surveyRepository, _categoryRepository); model.Load(CategoryId); return(View("~/Views/Survey/Index.cshtml", model)); }
public ActionResult Index() { var surveys = _context.Surveys.ToList(); var viewModel = new SurveyIndexViewModel() { Surveys = surveys, User = user }; return(View(viewModel)); }
// GET: /<controller>/ public IActionResult Index() { string UserID = _userManager.GetUserId(User); User this_User = _userService.GetById(UserID); SurveyIndexViewModel surveys = new SurveyIndexViewModel(); IEnumerable <Survey> allSurveys = _surveyService.GetAllSurveys(); surveys.surveys = allSurveys.Where(s => s.CreatorId == this_User.Id); return(View(surveys)); }
public IActionResult Index(SurveyIndexViewModel model) { return(View(model)); }