// GET: Neighborhood public ActionResult Index() { List <NeighborhoodListingVM> neighborhoodListingVM = new List <NeighborhoodListingVM>(); neighborhoodService.GetAllNeighborhoods().ToList().ForEach(c => { NeighborhoodListingVM neighborhoodListing = new NeighborhoodListingVM { ID = c.ID, Name = c.Name, }; neighborhoodListingVM.Add(neighborhoodListing); }); return(View(neighborhoodListingVM)); }
// GET: Student public ActionResult Index() { StudentVM student = new StudentVM(); student.Governorates = governorateService.GetAllGovernorates().Select(a => new SelectListItem { Text = a.Name, Value = a.ID.ToString() }).ToList(); student.Fields = fieldService.GetAllFields().Select(a => new SelectListItem { Text = a.Name, Value = a.ID.ToString() }).ToList(); student.Neighborhoods = neighborhoodService.GetAllNeighborhoods().Select(a => new SelectListItem { Text = a.Name, Value = a.ID.ToString() }).ToList(); return(View(student)); }