Show / Hide Table of Contents

Class DalBase<TEntity, TPrimaryKey>

ʵÌåÊý¾Ý·ÃÎʲã»ùÀà

Inheritance
System.Object
DalBase<TEntity, TPrimaryKey>
DalBase<TEntity>
Namespace: DapperDal
Assembly: DapperDal.dll
Syntax
public class DalBase<TEntity, TPrimaryKey> : object where TEntity : class
Type Parameters
Name Description
TEntity

ʵÌåÀàÐÍ

TPrimaryKey

ʵÌåID£¨Ö÷¼ü£©ÀàÐÍ

Constructors

| Improve this Doc View Source

DalBase()

ĬÈϳõʼ»¯ DAL ÐÂʵÀý

Declaration
public DalBase()
| Improve this Doc View Source

DalBase(String)

ÓÃÅäÖýڵãÃû³õʼ»¯ DAL ÐÂʵÀý

Declaration
public DalBase(string connNameOrConnStr)
Parameters
Type Name Description
System.String connNameOrConnStr

DBÁ¬½Ó×Ö·û´®ÅäÖýڵãÃû

Properties

| Improve this Doc View Source

Configuration

ÅäÖÃÏî

Declaration
public IDalConfiguration Configuration { get; }
Property Value
Type Description
IDalConfiguration
| Improve this Doc View Source

ConnectionString

DBÁ¬½Ó×Ö·û´®

Declaration
public string ConnectionString { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Options

ÅäÖÃÏî

Declaration
public DalOptions Options { get; }
Property Value
Type Description
DalOptions

Methods

| Improve this Doc View Source

Count()

获取实体条数

Declaration
public virtual int Count()
Returns
Type Description
System.Int32

实体条数

| Improve this Doc View Source

Count(Expression<Func<TEntity, Boolean>>)

根据条件获取实体条数 (条件使用表达式)

Declaration
public virtual int Count(Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

条件,使用表达式

Returns
Type Description
System.Int32

实体条数

| Improve this Doc View Source

Count(Object)

根据条件获取实体条数 (条件使用谓词或匿名对象)

Declaration
public virtual int Count(object predicate)
Parameters
Type Name Description
System.Object predicate

条件,使用谓词或匿名对象

Returns
Type Description
System.Int32

实体条数

| Improve this Doc View Source

Delete(TEntity)

删除指定实体

Declaration
public virtual bool Delete(TEntity entity)
Parameters
Type Name Description
TEntity entity

实体

Returns
Type Description
System.Boolean

删除结果

| Improve this Doc View Source

Delete(TPrimaryKey)

根据实体主键ID删除指定实体

Declaration
public virtual bool Delete(TPrimaryKey id)
Parameters
Type Name Description
TPrimaryKey id

实体主键ID

Returns
Type Description
System.Boolean

删除结果

| Improve this Doc View Source

Delete(Expression<Func<TEntity, Boolean>>)

根据条件删除实体

Declaration
public virtual bool Delete(Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

删除条件

Returns
Type Description
System.Boolean

删除结果

| Improve this Doc View Source

Delete(Object)

根据条件删除实体

Declaration
public virtual bool Delete(object predicate)
Parameters
Type Name Description
System.Object predicate

删除条件

Returns
Type Description
System.Boolean

删除结果

| Improve this Doc View Source

Execute(String)

执行SQL语句

Declaration
public virtual int Execute(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

Execute(String, Object)

执行参数化SQL语句

Declaration
public virtual int Execute(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

Execute(String, Object, CommandType)

执行参数化SQL语句

Declaration
public virtual int Execute(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

Execute(String, String)

执行SQL语句

Declaration
public virtual int Execute(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

Execute(String, String, Object)

执行参数化SQL语句

Declaration
public virtual int Execute(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

Execute(String, String, Object, CommandType)

执行参数化SQL语句

Declaration
public virtual int Execute(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
System.Int32

影响行数

| Improve this Doc View Source

ExecuteScalar<TAny>(String)

执行SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

ExecuteScalar<TAny>(String, Object)

执行参数化SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

ExecuteScalar<TAny>(String, Object, CommandType)

执行参数化SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

ExecuteScalar<TAny>(String, String)

执行SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

ExecuteScalar<TAny>(String, String, Object)

执行参数化SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

ExecuteScalar<TAny>(String, String, Object, CommandType)

执行参数化SQL语句,返回第一行第一列数据

Declaration
public virtual TAny ExecuteScalar<TAny>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TAny

第一行第一列数据

Type Parameters
Name Description
TAny

返回数据类型

| Improve this Doc View Source

Exsit()

判断实体是否存在

Declaration
public virtual bool Exsit()
Returns
Type Description
System.Boolean

是否存在

| Improve this Doc View Source

Exsit(TPrimaryKey)

判断指定主键ID的实体是否存在

Declaration
public virtual bool Exsit(TPrimaryKey id)
Parameters
Type Name Description
TPrimaryKey id

实体主键ID

Returns
Type Description
System.Boolean

是否存在

| Improve this Doc View Source

Exsit(Expression<Func<TEntity, Boolean>>)

判断指定条件的实体是否存在 (条件使用表达式)

Declaration
public virtual bool Exsit(Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

条件,使用表达式

Returns
Type Description
System.Boolean

是否存在

| Improve this Doc View Source

Exsit(Object)

判断指定条件的实体是否存在 (条件使用谓词或匿名对象)

Declaration
public virtual bool Exsit(object predicate)
Parameters
Type Name Description
System.Object predicate

条件,使用谓词或匿名对象

Returns
Type Description
System.Boolean

是否存在

| Improve this Doc View Source

Get(TPrimaryKey)

根据实体ID(主键)获取实体

Declaration
public virtual TEntity Get(TPrimaryKey id)
Parameters
Type Name Description
TPrimaryKey id

实体ID

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

GetFirst()

获取所有实体列表的第一条

Declaration
public virtual TEntity GetFirst()
Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(SortDirection, Expression<Func<TEntity, Object>>[])

根据排序条件获取所有实体列表的第一条 (排序使用表达式)

Declaration
public virtual TEntity GetFirst(SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Expression<Func<TEntity, Boolean>>)

根据查询条件获取实体列表的第一条 (查询使用表达式)

Declaration
public virtual TEntity GetFirst(Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Expression<Func<TEntity, Boolean>>, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表的第一条 (查询使用表达式,排序使用表达式)

Declaration
public virtual TEntity GetFirst(Expression<Func<TEntity, bool>> predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Expression<Func<TEntity, Boolean>>, Object)

根据查询条件和排序条件获取实体列表的第一条 (查询使用表达式,排序使用Sort或匿名对象)

Declaration
public virtual TEntity GetFirst(Expression<Func<TEntity, bool>> predicate, object sort)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Object)

根据查询条件获取实体列表的第一条 (查询使用谓词或匿名对象)

Declaration
public virtual TEntity GetFirst(object predicate)
Parameters
Type Name Description
System.Object predicate

查询条件

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Object, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表的第一条 (查询使用谓词或匿名对象,排序使用表达式)

Declaration
public virtual TEntity GetFirst(object predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Object predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetFirst(Object, Object)

根据查询条件和排序条件获取实体列表的第一条 (查询使用谓词或匿名对象,排序使用Sort或匿名对象)

Declaration
public virtual TEntity GetFirst(object predicate, object sort)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
TEntity

实体列表

| Improve this Doc View Source

GetList()

获取所有实体列表

Declaration
public virtual IEnumerable<TEntity> GetList()
Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(SortDirection, Expression<Func<TEntity, Object>>[])

根据排序条件获取所有实体列表 (排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetList(SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Expression<Func<TEntity, Boolean>>)

根据查询条件获取实体列表 (查询使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetList(Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Expression<Func<TEntity, Boolean>>, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表 (查询使用表达式,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetList(Expression<Func<TEntity, bool>> predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Expression<Func<TEntity, Boolean>>, Object)

根据查询条件和排序条件获取实体列表 (查询使用表达式,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetList(Expression<Func<TEntity, bool>> predicate, object sort)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Object)

根据查询条件获取实体列表 (查询使用谓词或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetList(object predicate)
Parameters
Type Name Description
System.Object predicate

查询条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Object, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表 (查询使用谓词或匿名对象,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetList(object predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Object predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetList(Object, Object)

根据查询条件和排序条件获取实体列表 (查询使用谓词或匿名对象,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetList(object predicate, object sort)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetListPaged(Expression<Func<TEntity, Boolean>>, Int32, Int32, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体分页列表 (查询使用表达式,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetListPaged(Expression<Func<TEntity, bool>> predicate, int pageNumber, int itemsPerPage, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Int32 pageNumber

页号,从1起始

System.Int32 itemsPerPage

每页条数

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体分页列表

| Improve this Doc View Source

GetListPaged(Expression<Func<TEntity, Boolean>>, Object, Int32, Int32)

根据查询条件和排序条件获取实体分页列表 (查询使用表达式,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetListPaged(Expression<Func<TEntity, bool>> predicate, object sort, int pageNumber, int itemsPerPage)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Object sort

排序条件

System.Int32 pageNumber

页号,从1起始

System.Int32 itemsPerPage

每页条数

Returns
Type Description
IEnumerable<TEntity>

实体分页列表

| Improve this Doc View Source

GetListPaged(Object, Int32, Int32, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体分页列表 (查询使用谓词或匿名对象,排序表达式)

Declaration
public virtual IEnumerable<TEntity> GetListPaged(object predicate, int pageNumber, int itemsPerPage, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Int32 pageNumber

页号,从1起始

System.Int32 itemsPerPage

每页条数

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体分页列表

| Improve this Doc View Source

GetListPaged(Object, Object, Int32, Int32)

根据查询条件和排序条件获取实体分页列表 (查询使用谓词或匿名对象,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetListPaged(object predicate, object sort, int pageNumber, int itemsPerPage)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Object sort

排序条件

System.Int32 pageNumber

页号,从1起始

System.Int32 itemsPerPage

每页条数

Returns
Type Description
IEnumerable<TEntity>

实体分页列表

| Improve this Doc View Source

GetSet(Expression<Func<TEntity, Boolean>>, Int32, Int32, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体区间列表 (查询使用表达式,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetSet(Expression<Func<TEntity, bool>> predicate, int firstResult, int maxResults, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Int32 firstResult

起始行数

System.Int32 maxResults

最大条数

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体区间列表

| Improve this Doc View Source

GetSet(Expression<Func<TEntity, Boolean>>, Object, Int32, Int32)

根据查询条件和排序条件获取实体区间列表 (查询使用表达式,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetSet(Expression<Func<TEntity, bool>> predicate, object sort, int firstResult, int maxResults)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Object sort

排序条件

System.Int32 firstResult

起始行数

System.Int32 maxResults

最大条数

Returns
Type Description
IEnumerable<TEntity>

实体区间列表

| Improve this Doc View Source

GetSet(Object, Int32, Int32, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体区间列表 (查询使用谓词或匿名对象,排序表达式)

Declaration
public virtual IEnumerable<TEntity> GetSet(object predicate, int firstResult, int maxResults, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Int32 firstResult

起始行数

System.Int32 maxResults

最大条数

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体区间列表

| Improve this Doc View Source

GetSet(Object, Object, Int32, Int32)

根据查询条件和排序条件获取实体区间列表 (查询使用谓词或匿名对象,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetSet(object predicate, object sort, int firstResult, int maxResults)
Parameters
Type Name Description
System.Object predicate

查询条件

System.Object sort

排序条件

System.Int32 firstResult

起始行数

System.Int32 maxResults

最大条数

Returns
Type Description
IEnumerable<TEntity>

实体区间列表

| Improve this Doc View Source

GetTop(Int32)

获取所有实体列表的前N条

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit)
Parameters
Type Name Description
System.Int32 limit

前几条

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, SortDirection, Expression<Func<TEntity, Object>>[])

根据排序条件获取所有实体列表的前N条 (排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Int32 limit

前几条

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Expression<Func<TEntity, Boolean>>)

根据查询条件获取实体列表的前N条 (查询使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
System.Int32 limit

前几条

Expression<Func<TEntity, System.Boolean>> predicate

查询条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Expression<Func<TEntity, Boolean>>, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表的前N条 (查询使用表达式,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, Expression<Func<TEntity, bool>> predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Int32 limit

前几条

Expression<Func<TEntity, System.Boolean>> predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Expression<Func<TEntity, Boolean>>, Object)

根据查询条件和排序条件获取实体列表的前N条 (查询使用表达式,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, Expression<Func<TEntity, bool>> predicate, object sort)
Parameters
Type Name Description
System.Int32 limit

前几条

Expression<Func<TEntity, System.Boolean>> predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Object)

根据查询条件获取实体列表的前N条 (查询使用谓词或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, object predicate)
Parameters
Type Name Description
System.Int32 limit

前几条

System.Object predicate

查询条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Object, SortDirection, Expression<Func<TEntity, Object>>[])

根据查询条件和排序条件获取实体列表的前N条 (查询使用谓词或匿名对象,排序使用表达式)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, object predicate, SortDirection ascending, params Expression<Func<TEntity, object>>[] sortingExpression)
Parameters
Type Name Description
System.Int32 limit

前几条

System.Object predicate

查询条件

SortDirection ascending

排序方向

Expression<Func<TEntity, System.Object>>[] sortingExpression

排序字段

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

GetTop(Int32, Object, Object)

根据查询条件和排序条件获取实体列表的前N条 (查询使用谓词或匿名对象,排序使用Sort或匿名对象)

Declaration
public virtual IEnumerable<TEntity> GetTop(int limit, object predicate, object sort)
Parameters
Type Name Description
System.Int32 limit

前几条

System.Object predicate

查询条件

System.Object sort

排序条件

Returns
Type Description
IEnumerable<TEntity>

实体列表

| Improve this Doc View Source

Insert(TEntity)

插入指定实体

Declaration
public virtual TPrimaryKey Insert(TEntity entity)
Parameters
Type Name Description
TEntity entity

实体

Returns
Type Description
TPrimaryKey

实体主键

| Improve this Doc View Source

Insert(IEnumerable<TEntity>)

批量插入指定实体集合

Declaration
public virtual void Insert(IEnumerable<TEntity> entities)
Parameters
Type Name Description
IEnumerable<TEntity> entities

实体集合

| Improve this Doc View Source

OpenConnection()

´ò¿ªDBÁ¬½Ó

Declaration
protected virtual IDbConnection OpenConnection()
Returns
Type Description
IDbConnection

DBÁ¬½Ó

| Improve this Doc View Source

OpenConnection(String)

´ò¿ªDBÁ¬½Ó

Declaration
protected virtual IDbConnection OpenConnection(string connNameOrConnStr)
Parameters
Type Name Description
System.String connNameOrConnStr

DB Á¬½Ó×Ö·û´®ÅäÖýڵãÃû

Returns
Type Description
IDbConnection

DBÁ¬½Ó

| Improve this Doc View Source

Query(String)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query(String, Object)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query(String, Object, CommandType)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query(String, String)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query(String, String, Object)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query(String, String, Object, CommandType)

使用SQL语句获取实体集合

Declaration
public virtual IEnumerable<TEntity> Query(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
IEnumerable<TEntity>

实体集合

| Improve this Doc View Source

Query<TAny>(String)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

Query<TAny>(String, Object)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

Query<TAny>(String, Object, CommandType)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

Query<TAny>(String, String)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

Query<TAny>(String, String, Object)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

Query<TAny>(String, String, Object, CommandType)

使用SQL语句获取指定实体集合

Declaration
public virtual IEnumerable<TAny> Query<TAny>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
IEnumerable<TAny>

实体集合

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryDataSet(String)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryDataSet(String, Object)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryDataSet(String, Object, CommandType)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryDataSet(String, String)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryDataSet(String, String, Object)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryDataSet(String, String, Object, CommandType)

执行 SQL 语句返回 DataSet

Declaration
public virtual DataSet QueryDataSet(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
DataSet

DataSet

| Improve this Doc View Source

QueryFirst(String)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst(String, Object)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst(String, Object, CommandType)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst(String, String)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst(String, String, Object)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst(String, String, Object, CommandType)

使用SQL语句获取实体

Declaration
public virtual TEntity QueryFirst(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TEntity

实体

| Improve this Doc View Source

QueryFirst<TAny>(String)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryFirst<TAny>(String, Object)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryFirst<TAny>(String, Object, CommandType)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryFirst<TAny>(String, String)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryFirst<TAny>(String, String, Object)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryFirst<TAny>(String, String, Object, CommandType)

使用SQL语句获取指定实体

Declaration
public virtual TAny QueryFirst<TAny>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
TAny

实体

Type Parameters
Name Description
TAny

返回实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>> QueryMultiple<TFirst, TSecond>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>> QueryMultiple<TFirst, TSecond, TThird>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>> QueryMultiple<TFirst, TSecond, TThird, TFourth>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string sql, object parameters)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String, String)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string connNameOrConnStr, string sql)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String, String, Object)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string connNameOrConnStr, string sql, object parameters)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(String, String, Object, CommandType)

使用SQL语句获取多个指定实体集合

Declaration
public virtual Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>> QueryMultiple<TFirst, TSecond, TThird, TFourth, TFifth, TSixth, TSeventh, TEighth>(string connNameOrConnStr, string sql, object parameters, CommandType commandType)
Parameters
Type Name Description
System.String connNameOrConnStr

DB 连接字符串配置节点名

System.String sql

SQL语句

System.Object parameters

SQL参数

CommandType commandType

SQL语句命令类型

Returns
Type Description
Tuple<IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IEnumerable<TFourth>, IEnumerable<TFifth>, IEnumerable<TSixth>, IEnumerable<TSeventh>, Tuple<IEnumerable<TEighth>>>

多个实体集合

Type Parameters
Name Description
TFirst

第一个实体类型

TSecond

第二个实体类型

TThird

第三个实体类型

TFourth

第四个实体类型

TFifth

第五个实体类型

TSixth

第六个实体类型

TSeventh

第七个实体类型

TEighth

第八个实体类型

| Improve this Doc View Source

SoftDelete(TEntity, Object)

逻辑删除指定实体

Declaration
public virtual bool SoftDelete(TEntity entity, object props = null)
Parameters
Type Name Description
TEntity entity

实体

System.Object props

逻辑删除属性名及更新值,默认 IsActive=0

Returns
Type Description
System.Boolean

逻辑删除结果

| Improve this Doc View Source

SoftDelete(TPrimaryKey, Object)

根据实体主键ID逻辑删除指定实体

Declaration
public virtual bool SoftDelete(TPrimaryKey id, object props = null)
Parameters
Type Name Description
TPrimaryKey id

实体主键ID

System.Object props

逻辑删除属性名及更新值,默认 IsActive=0

Returns
Type Description
System.Boolean

逻辑删除结果

| Improve this Doc View Source

SoftDelete(Expression<Func<TEntity, Boolean>>, Object)

根据条件逻辑删除实体

Declaration
public virtual bool SoftDelete(Expression<Func<TEntity, bool>> predicate, object props = null)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

删除条件

System.Object props

逻辑删除属性名及更新值,默认 IsActive=0 }

Returns
Type Description
System.Boolean

逻辑删除结果

| Improve this Doc View Source

SoftDelete(Object, Object)

根据条件逻辑删除实体

Declaration
public virtual bool SoftDelete(object predicate, object props = null)
Parameters
Type Name Description
System.Object predicate

删除条件

System.Object props

逻辑删除属性名及更新值,默认 IsActive=0

Returns
Type Description
System.Boolean

逻辑删除结果

| Improve this Doc View Source

SwitchActive(TEntity, Boolean, Object, Object)

逻辑删除或激活指定实体

Declaration
public virtual bool SwitchActive(TEntity entity, bool isActive, object softDeleteProps = null, object softActiveProps = null)
Parameters
Type Name Description
TEntity entity

实体

System.Boolean isActive

是否激活,true:激活,false:逻辑删除

System.Object softDeleteProps

逻辑删除属性名及更新值,默认:IsActive=0

System.Object softActiveProps

激活属性名及更新值,默认:IsActive=1

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

SwitchActive(TPrimaryKey, Boolean, Object, Object)

根据实体主键ID逻辑删除或激活指定实体

Declaration
public virtual bool SwitchActive(TPrimaryKey id, bool isActive, object softDeleteProps = null, object softActiveProps = null)
Parameters
Type Name Description
TPrimaryKey id

实体主键ID

System.Boolean isActive

是否激活,true:激活,false:逻辑删除

System.Object softDeleteProps

逻辑删除属性名及更新值,默认:IsActive=0

System.Object softActiveProps

激活属性名及更新值,默认:IsActive=1

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

SwitchActive(Expression<Func<TEntity, Boolean>>, Boolean, Object, Object)

根据条件逻辑删除或激活实体

Declaration
public virtual bool SwitchActive(Expression<Func<TEntity, bool>> predicate, bool isActive, object softDeleteProps = null, object softActiveProps = null)
Parameters
Type Name Description
Expression<Func<TEntity, System.Boolean>> predicate

删除条件

System.Boolean isActive

是否激活,true:激活,false:逻辑删除

System.Object softDeleteProps

逻辑删除属性名及更新值,默认:IsActive=0

System.Object softActiveProps

激活属性名及更新值,默认:IsActive=1

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

SwitchActive(Object, Boolean, Object, Object)

根据条件逻辑删除或激活实体

Declaration
public virtual bool SwitchActive(object predicate, bool isActive, object softDeleteProps = null, object softActiveProps = null)
Parameters
Type Name Description
System.Object predicate

删除条件

System.Boolean isActive

是否激活,true:激活,false:逻辑删除

System.Object softDeleteProps

逻辑删除属性名及更新值,默认:IsActive=0

System.Object softActiveProps

激活属性名及更新值,默认:IsActive=1

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(TEntity)

更新指定实体

Declaration
public virtual bool Update(TEntity entity)
Parameters
Type Name Description
TEntity entity

实体

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(TEntity, IEnumerable<String>)

更新指定实体指定属性

Declaration
public virtual bool Update(TEntity entity, IEnumerable<string> props)
Parameters
Type Name Description
TEntity entity

实体

IEnumerable<System.String> props

要更新的属性名列表

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(TEntity, Object)

更新指定实体指定属性

Declaration
public virtual bool Update(TEntity entity, object props)
Parameters
Type Name Description
TEntity entity

实体

System.Object props

要更新的属性名列表,以匿名对象提供

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(TPrimaryKey, Object)

更新指定实体指定属性

Declaration
public virtual bool Update(TPrimaryKey id, object props)
Parameters
Type Name Description
TPrimaryKey id

实体主键ID

System.Object props

更新属性名

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(Object)

根据指定指定主键ID更新实体指定属性 (条件使用实体主键ID)

Declaration
public virtual bool Update(object keyAndProps)
Parameters
Type Name Description
System.Object keyAndProps

更新实体,包含主键ID、更新属性及值

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(Object, Expression<Func<TEntity, Boolean>>)

根据指定更新条件更新实体指定属性 (条件使用表达式)

Declaration
public virtual bool Update(object props, Expression<Func<TEntity, bool>> predicate)
Parameters
Type Name Description
System.Object props

更新属性及值

Expression<Func<TEntity, System.Boolean>> predicate

更新条件,使用表达式

Returns
Type Description
System.Boolean

更新结果

| Improve this Doc View Source

Update(Object, Object)

根据指定更新条件更新实体指定属性 (条件使用谓词或匿名对象)

Declaration
public virtual bool Update(object props, object predicate)
Parameters
Type Name Description
System.Object props

更新属性及值

System.Object predicate

更新条件,使用谓词或匿名对象

Returns
Type Description
System.Boolean

更新结果

Extension Methods

SortingExtensions.ToSortable(Object)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX