public ActionResult EmailQueueDetail(int?page) { List <EmailQueue> emailQueueList = new List <EmailQueue>(); EmailQueueRepositery _EmailQueueRepositeryObject = new EmailQueueRepositery(); emailQueueList = _EmailQueueRepositeryObject.GetEamilQueueDetail(); int pageSize = 5; int pageNumber = (page ?? 1); emailQueueList.OrderByDescending(x => x.CreatedOn); return(View(emailQueueList.ToList().ToPagedList(pageNumber, pageSize))); }