Beispiel #1
0
        // GET: Location/Create
        public ActionResult Create()
        {
            var campusModel = _campusService.GetAll();

            ViewBag.campusViewModel = Mapper.Map <IEnumerable <Campus>, IEnumerable <CampusViewModel> >(campusModel);

            var viewModel = new LocationViewModel();

            return(View(viewModel));
        }
 private IEnumerable <SelectListItem> PopulateCampusesList()
 {
     return(_campusService.GetAll().Select(x => new SelectListItem
     {
         Value = x.CampusID.ToString(),
         Text = x.CampusName
     }));
 }