public static async Task <PagedView <T> > ToPagedViewAsync <T>(this IQueryable <T> query, IPagedBinding binding, long?count = null) { return(new PagedView <T>() { Count = count ?? query.Count(), Items = await query.Page(binding).ToListAsync() }); }