public List<string> ListDocs(string filter, Pagination pagination) { return Query(filter, pagination.Skip, pagination.PageItemCount) .Sort(Builders<BsonDocument>.Sort.Descending("_id")) .ToEnumerable() .Select(d => d.GetValue("_id").ToString()) .ToList(); }
public CollectionViewModel(string title, string filter, int page, Collection collection) { var stats = collection.GetStats(); var pagination = new Pagination(page, 20, (int)stats.count); Title = title; DatabaseName = collection.DatabaseName; CollectionName = collection.Name; Stats = stats; Page = pagination.Page; LastPage = pagination.LastPage; Docs = collection.ListDocs(filter, pagination); }