예제 #1
0
        public async Task <PaginatedList <FacultyModel> > Get(SearchModel model)
        {
            var spec = model.ToSpecification <Faculty>();

            var entities = await repository.Get(spec);

            var count = await repository.CountAsync();

            return(new PaginatedList <FacultyModel>(
                       model.PageIndex,
                       entities.Count,
                       count,
                       mapper.Map <IList <FacultyModel> >(entities)));
        }