public CreateMemberViewModel Create() { var categories = _categoriesListQuery.Execute(); var viewModel = new CreateMemberViewModel(); viewModel.Categories = categories .Select(x => new SelectListItem() { Value = x.Id.ToString(), Text = x.Name }) .ToList(); viewModel.Member = new CreateMemberModel(); return(viewModel); }
public ViewResult Index() { var categories = _categoriesListQuery.Execute(); return(View(categories)); }