/// <summary> /// /// </summary> /// <param name="request"></param> /// <returns></returns> public DatatablesView <UserTaskModel> GetUserTasksByPaging(DataTablesPaging request) { int total = 0; var pagingItems = UserTaskRepository.GetItemsByPaging(request, out total); var items = new List <UserTaskModel>(); foreach (var pagingItem in pagingItems) { var item = pagingItem.ToModel(); items.Add(item); } return(new DatatablesView <UserTaskModel>(request.Draw, total, pagingItems.Count, items)); }