Fantasy
搜索结果

    显示/隐藏目录

    IDateBase 接口

    表示用于执行各种数据库操作的数据库接口。

    命名空间: Fantasy.DataBase
    程序集: Fantasy.Net.dll
    语法
    public interface IDateBase

    方法

    | 编辑本文 查看源代码

    Count<T>(Expression<Func<T, bool>>, string)

    在指定的集合中检索满足给定筛选条件的类型 T 的实体数量。

    声明
    FTask<long> Count<T>(Expression<Func<T, bool>> filter, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Count<T>(string)

    在指定的集合中检索类型 T 的实体数量。

    声明
    FTask<long> Count<T>(string collection = null) where T : Entity
    参数
    类型 名称 描述
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    CreateDB(Type)

    根据指定类型创建数据库,用于存储实体。

    声明
    FTask CreateDB(Type type)
    参数
    类型 名称 描述
    Type type
    返回
    类型 描述
    FTask
    | 编辑本文 查看源代码

    CreateDB<T>()

    创建指定类型 T 的数据库,用于存储实体。

    声明
    FTask CreateDB<T>() where T : Entity
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    CreateIndex<T>(params object[])

    在默认集合中创建索引,以提高类型 T 实体的查询性能。

    声明
    FTask CreateIndex<T>(params object[] keys) where T : Entity
    参数
    类型 名称 描述
    object[] keys
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    CreateIndex<T>(string, params object[])

    在指定的集合中创建索引,以提高类型 T 实体的查询性能。

    声明
    FTask CreateIndex<T>(string collection, params object[] keys) where T : Entity
    参数
    类型 名称 描述
    string collection
    object[] keys
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Exist<T>(Expression<Func<T, bool>>, string)

    检查指定集合中是否存在满足给定筛选条件的类型 T 的实体。

    声明
    FTask<bool> Exist<T>(Expression<Func<T, bool>> filter, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<bool>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Exist<T>(string)

    检查指定集合中是否存在类型 T 的实体。

    声明
    FTask<bool> Exist<T>(string collection = null) where T : Entity
    参数
    类型 名称 描述
    string collection
    返回
    类型 描述
    FTask<bool>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    First<T>(Expression<Func<T, bool>>, string)

    检索满足给定筛选条件的类型 T 的第一个实体,从指定集合中。

    声明
    FTask<T?> First<T>(Expression<Func<T, bool>> filter, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<T>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    First<T>(string, string[], string)

    查询指定集合中满足给定 JSON 查询字符串的类型 T 的第一个实体,仅返回指定列的数据。

    声明
    FTask<T> First<T>(string json, string[] cols, string collection = null) where T : Entity
    参数
    类型 名称 描述
    string json
    string[] cols
    string collection
    返回
    类型 描述
    FTask<T>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Initialize(Scene, string, string)

    初始化数据库连接。

    声明
    IDateBase Initialize(Scene scene, string connectionString, string dbName)
    参数
    类型 名称 描述
    Scene scene
    string connectionString
    string dbName
    返回
    类型 描述
    IDateBase
    | 编辑本文 查看源代码

    InsertBatch<T>(IEnumerable<T>, string)

    批量插入一组类型 T 实体到指定集合中,如果集合不存在将自动创建。

    声明
    FTask InsertBatch<T>(IEnumerable<T> list, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    IEnumerable<T> list
    string collection
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    InsertBatch<T>(object, IEnumerable<T>, string)

    通过事务会话,批量插入一组类型 T 实体到指定集合中,如果集合不存在将自动创建。

    声明
    FTask InsertBatch<T>(object transactionSession, IEnumerable<T> list, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    object transactionSession
    IEnumerable<T> list
    string collection
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Insert<T>(T, string)

    向指定集合中插入一个类型 T 实体,如果集合不存在将自动创建。

    声明
    FTask Insert<T>(T entity, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    T entity
    string collection
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Query(long, List<string>, List<Entity>)

    查询指定 ID 的多个集合,将结果存储在给定的实体列表中。

    声明
    FTask Query(long id, List<string> collectionNames, List<Entity> result)
    参数
    类型 名称 描述
    long id
    List<string> collectionNames
    List<Entity> result
    返回
    类型 描述
    FTask
    | 编辑本文 查看源代码

    QueryByPageOrderBy<T>(Expression<Func<T, bool>>, int, int, Expression<Func<T, object>>, bool, string)

    从指定集合中按页查询满足给定筛选条件的类型 T 的实体列表,按指定字段排序。

    声明
    FTask<List<T>> QueryByPageOrderBy<T>(Expression<Func<T, bool>> filter, int pageIndex, int pageSize, Expression<Func<T, object>> orderByExpression, bool isAsc = true, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    int pageIndex
    int pageSize
    Expression<Func<T, object>> orderByExpression
    bool isAsc
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryByPage<T>(Expression<Func<T, bool>>, int, int, string)

    分页查询指定集合中满足给定筛选条件的类型 T 的实体列表。

    声明
    FTask<List<T>> QueryByPage<T>(Expression<Func<T, bool>> filter, int pageIndex, int pageSize, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    int pageIndex
    int pageSize
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryByPage<T>(Expression<Func<T, bool>>, int, int, string[], string)

    分页查询指定集合中满足给定筛选条件的类型 T 的实体列表,仅返回指定列的数据。

    声明
    FTask<List<T>> QueryByPage<T>(Expression<Func<T, bool>> filter, int pageIndex, int pageSize, string[] cols, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    int pageIndex
    int pageSize
    string[] cols
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryCountAndDatesByPage<T>(Expression<Func<T, bool>>, int, int, string)

    按页查询满足给定筛选条件的类型 T 的实体数量和日期。

    声明
    FTask<(int count, List<T> dates)> QueryCountAndDatesByPage<T>(Expression<Func<T, bool>> filter, int pageIndex, int pageSize, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    int pageIndex
    int pageSize
    string collection
    返回
    类型 描述
    FTask<(int count, List<T> dates)>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryCountAndDatesByPage<T>(Expression<Func<T, bool>>, int, int, string[], string)

    按页查询满足给定筛选条件的类型 T 的实体数量和日期。

    声明
    FTask<(int count, List<T> dates)> QueryCountAndDatesByPage<T>(Expression<Func<T, bool>> filter, int pageIndex, int pageSize, string[] cols, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    int pageIndex
    int pageSize
    string[] cols
    string collection
    返回
    类型 描述
    FTask<(int count, List<T> dates)>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryJson<T>(long, string, string)

    根据给定的 JSON 查询字符串查询指定集合中的类型 T 实体列表,通过指定的任务 ID 进行标识。

    声明
    FTask<List<T>> QueryJson<T>(long taskId, string json, string collection = null) where T : Entity
    参数
    类型 名称 描述
    long taskId
    string json
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryJson<T>(string, string)

    根据给定的 JSON 查询字符串查询指定集合中的类型 T 实体列表。

    声明
    FTask<List<T>> QueryJson<T>(string json, string collection = null) where T : Entity
    参数
    类型 名称 描述
    string json
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryJson<T>(string, string[], string)

    根据给定的 JSON 查询字符串查询指定集合中的类型 T 实体列表,仅返回指定列的数据。

    声明
    FTask<List<T>> QueryJson<T>(string json, string[] cols, string collection = null) where T : Entity
    参数
    类型 名称 描述
    string json
    string[] cols
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryNotLock<T>(long, string)

    从指定集合中检索指定 ID 的类型 T 的实体,不锁定。

    声明
    FTask<T> QueryNotLock<T>(long id, string collection = null) where T : Entity
    参数
    类型 名称 描述
    long id
    string collection
    返回
    类型 描述
    FTask<T>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    QueryOrderBy<T>(Expression<Func<T, bool>>, Expression<Func<T, object>>, bool, string)

    从指定集合中按页查询满足给定筛选条件的类型 T 的实体列表,按指定字段排序。

    声明
    FTask<List<T>> QueryOrderBy<T>(Expression<Func<T, bool>> filter, Expression<Func<T, object>> orderByExpression, bool isAsc = true, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    Expression<Func<T, object>> orderByExpression
    bool isAsc
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Query<T>(long, string)

    从指定集合中检索指定 ID 的类型 T 的实体。

    声明
    FTask<T> Query<T>(long id, string collection = null) where T : Entity
    参数
    类型 名称 描述
    long id
    string collection
    返回
    类型 描述
    FTask<T>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Query<T>(Expression<Func<T, bool>>, string)

    从指定集合中按页查询满足给定筛选条件的类型 T 的实体列表。

    声明
    FTask<List<T>> Query<T>(Expression<Func<T, bool>> filter, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Query<T>(Expression<Func<T, bool>>, string[], string)

    查询指定集合中满足给定筛选条件的类型 T 实体列表,仅返回指定列的数据。

    声明
    FTask<List<T>> Query<T>(Expression<Func<T, bool>> filter, string[] cols, string collection = null) where T : class
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    string[] cols
    string collection
    返回
    类型 描述
    FTask<List<T>>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Remove<T>(long, Expression<Func<T, bool>>, string)

    根据给定的筛选条件从数据库中删除指定类型 T 实体。

    声明
    FTask<long> Remove<T>(long coroutineLockQueueKey, Expression<Func<T, bool>> filter, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    long coroutineLockQueueKey
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Remove<T>(long, object, Expression<Func<T, bool>>, string)

    通过事务会话,根据给定的筛选条件从数据库中删除指定类型 T 实体。

    声明
    FTask<long> Remove<T>(long coroutineLockQueueKey, object transactionSession, Expression<Func<T, bool>> filter, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    long coroutineLockQueueKey
    object transactionSession
    Expression<Func<T, bool>> filter
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Remove<T>(long, string)

    根据指定的 ID 从数据库中删除指定类型 T 实体。

    声明
    FTask<long> Remove<T>(long id, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    long id
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Remove<T>(object, long, string)

    通过事务会话,根据指定的 ID 从数据库中删除指定类型 T 实体。

    声明
    FTask<long> Remove<T>(object transactionSession, long id, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    object transactionSession
    long id
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Save(long, List<Entity>)

    保存一组实体到数据库中,根据实体列表的 ID 进行区分和存储。

    声明
    FTask Save(long id, List<Entity> entities)
    参数
    类型 名称 描述
    long id
    List<Entity> entities
    返回
    类型 描述
    FTask
    | 编辑本文 查看源代码

    Save<T>(object, T, string)

    通过事务会话将类型 T 实体保存到指定集合中,如果集合不存在将自动创建。

    声明
    FTask Save<T>(object transactionSession, T entity, string collection = null) where T : Entity
    参数
    类型 名称 描述
    object transactionSession
    T entity
    string collection
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Save<T>(T, string)

    保存类型 T 实体到指定集合中,如果集合不存在将自动创建。

    声明
    FTask Save<T>(T entity, string collection = null) where T : Entity, new()
    参数
    类型 名称 描述
    T entity
    string collection
    返回
    类型 描述
    FTask
    类型参数
    名称 描述
    T
    | 编辑本文 查看源代码

    Sum<T>(Expression<Func<T, bool>>, Expression<Func<T, object>>, string)

    根据给定的筛选条件计算指定集合中类型 T 实体某个属性的总和。

    声明
    FTask<long> Sum<T>(Expression<Func<T, bool>> filter, Expression<Func<T, object>> sumExpression, string collection = null) where T : Entity
    参数
    类型 名称 描述
    Expression<Func<T, bool>> filter
    Expression<Func<T, object>> sumExpression
    string collection
    返回
    类型 描述
    FTask<long>
    类型参数
    名称 描述
    T

    扩展方法

    JsonHelper.ToJson<T>(T)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX