public ActionResult List() { CommunityListViewModel viewModel = new CommunityListViewModel { Communities = CommunityShedData.GetCommunityListItems(CustomUser.Person.Id) }; return(View(viewModel)); }
public ActionResult Profile() { var U_Name = Session["LogedInUser"].ToString(); CommunityListViewModel model = new CommunityListViewModel { Communities = repository.Communities .Where(p => p.Email == U_Name) }; return(View(model)); }
// 글 본문 public CommunityListViewModel GetCommunity(int CommunityId) { var query = (from accountUser in context.AccountUsers join community in context.Communitys on accountUser.Id equals community.Id where community.CommunityId == CommunityId select new { accountUser, community }).FirstOrDefault(); CommunityListViewModel viewModel = new CommunityListViewModel { Community = query.community, AccountUser = query.accountUser }; return(viewModel); }
public ViewResult List(int page = 1) { CommunityListViewModel model = new CommunityListViewModel { Communities = repository.Communities .OrderBy(p => p.ResidentId) .Skip((page - 1) * PageSize) .Take(PageSize), PagingInfo = new PagingInfo { CurrentPage = page, ItemsPerPage = PageSize, TotalItems = repository.Communities.Count() }, }; return(View(model)); }