// GET: Create public async Task <ActionResult> Create() { var govs = await _governorateRepository.GetGovernorates(); var model = new StudentViewModel { Fields = new SelectList(await _fieldRepository.GetFields(), "ID", "Name"), Governorates = new SelectList(govs, "ID", "Name"), Neighborhoods = new SelectList(await _neighborhoodRepository.GetNeighborhoodsOfGovernrate(govs.FirstOrDefault().ID), "ID", "Name"), Student = new Student() }; return(View(model)); }
// GET: Neighbourhood public async Task <ActionResult> Index(int govId) { var allNeighs = await _neighborhood.GetNeighborhoodsOfGovernrate(govId); return(PartialView("_GetNeighbourhoods", allNeighs)); }