Esempio n. 1
0
        public IActionResult UniversityFullInfo(int IDUniversity)
        {
            var university          = _universityRepository.Get(IDUniversity);
            var universityViewModel = Mapper.Map <UniversityViewModel>(university);

            universityViewModel.StudentCount = university.Students.Count();
            return(View(universityViewModel));
        }
Esempio n. 2
0
        public async Task <PaginatedList <UniversityModel> > Get(SearchModel model)
        {
            var spec = model.ToSpecification <University>();

            var entities = await repository.Get(spec);

            var count = await repository.CountAsync();

            return(new PaginatedList <UniversityModel>(
                       model.PageIndex,
                       entities.Count,
                       count,
                       mapper.Map <IList <UniversityModel> >(entities)));
        }
Esempio n. 3
0
 public TEntity Get(int id)
 {
     return(repo.Get(id));
 }
 public ActionResult Edit(int id)
 {
     return(View(uniRepo.Get(id)));
 }