Example #1
0
 public static T[] Paginate <T, TKey>(
     this ICrudService <T, TKey> service,
     int perPage,
     int pageNo
     )
     where T : class, IEntity <TKey>
 {
     return(Queryable.Skip <T>(service
                               .All(), perPage * pageNo)
            .Take(perPage)
            .ToArray());
 }
Example #2
0
        public virtual ActionResult Index()
        {
            var dto = _service.All();

            return(View("Index", Mapper.Map <IEnumerable <TViewModel> >(dto)));
        }