Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
This 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
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas