/// <summary> /// 根据集合中的所有数据 /// </summary> /// <typeparam name="T">数据类型</typeparam> /// <param name="collectionName">集合名称</param> /// <returns>数据对象集合</returns> public static List <T> GetAll <T>(string collectionName) where T : IEntity <string> { return(MongoDbHepler.GetAll <T>(nosqlConnectionString, nosqlDbName, collectionName).ToList()); }
/// <summary> /// 分页查询 swj /// </summary> /// <typeparam name="T"></typeparam> /// <param name="collectionName">文档名称</param> /// <param name="query">查询条件</param> /// <param name="pageInfo">分页条件</param> /// <param name="sortBy">排序条件</param> /// <param name="fields">关键字</param> /// <returns></returns> public static List <T> GetAll <T>(string collectionName, IMongoQuery query, PagerInfo pageInfo, IMongoSortBy sortBy, params string[] fields) where T : IEntity <string> { return(MongoDbHepler.GetAll <T>(collectionName, query, pageInfo, sortBy, fields).ToList()); }
/// <summary> /// 根据集合中的所有数据 /// </summary> /// <typeparam name="T">数据类型</typeparam> /// <param name="collectionName">集合名称</param> /// <returns>数据对象集合</returns> public static List <T> GetAll <T>(string collectionName) { return(MongoDbHepler.GetAll <MongoModel <T> >(nosqlConnectionString, nosqlDbName, collectionName).Select(u => u.Data).ToList());; }