public virtual void Init(Repository repository, CollegesRepository collegesRepository) { CollegeSelectListItems = new SelectList( collegesRepository.GetList() , "Id" , "CollegeName" ); }
public ICollection <College> GetColleges() { try { return(CollegesRepository.GetList()); } catch (Exception) { return(new List <College>()); } }
public ICollection <Faculty> GetFacultiesInCollege(string collegeName) { try { var college = CollegesRepository.GetList().Where(x => x.Name == collegeName).First(); return(FacultiesRepository.GetList(college)); } catch (Exception) { return(new List <Faculty>()); } }
public ActionResult Index() { var colleges = _collegesRepository.GetList(); return(View(colleges)); }