Views: 7.9K
Replies: 1
Archived
|
WCF Webservice Result Set with Server Side PagingAre there any patterns or examples on how to implement server side paging for webservice calls that returns large number of records back to the client? Yassin Khan, Nov 09, 2011
|
|
Reply 1This is what I use:
public List<BlogApp6.BusinessObjects.Blog> GetAll( string sortExpression, int startRowIndex, int maximumRows) { using (var context = DataObjectFactory.CreateContext()) { IQueryable<BlogApp6.DataObjects.EntityFramework.Blog> query = context.Blogs.AsQueryable().OrderBy(sortExpression); query = query.Skip(startRowIndex).Take(maximumRows); var list = new List<BlogApp6.BusinessObjects.Blog>(); foreach (BlogApp6.DataObjects.EntityFramework.Blog entity in query) list.Add(BlogMapper.ToBusinessObject(entity)); return list; } } I hope this helps. King Wilder, Dec 08, 2011
|