Show / Hide Table of Contents

Class SqlDialectBase

SQL方言基类

Inheritance
System.Object
SqlDialectBase
SqlServerDialect
Namespace: DapperDal.Sql
Assembly: DapperDal.dll
Syntax
public abstract class SqlDialectBase : object, ISqlDialect

Properties

| Improve this Doc View Source

BatchSeperator

表示批次分割的字符串

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

CloseQuote

表示右引号的字符

Declaration
public virtual char CloseQuote { get; }
Property Value
Type Description
System.Char
Implements
ISqlDialect.CloseQuote
| Improve this Doc View Source

EmptyExpression

表示空表达式的字符串

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

OpenQuote

表示左引号的字符

Declaration
public virtual char OpenQuote { get; }
Property Value
Type Description
System.Char
Implements
ISqlDialect.OpenQuote
| Improve this Doc View Source

ParameterPrefix

表示参数前缀的字符

Declaration
public virtual char ParameterPrefix { get; }
Property Value
Type Description
System.Char
Implements
ISqlDialect.ParameterPrefix
| Improve this Doc View Source

SupportsMultipleStatements

是否支持多语句执行

Declaration
public virtual bool SupportsMultipleStatements { get; }
Property Value
Type Description
System.Boolean
Implements
ISqlDialect.SupportsMultipleStatements

Methods

| Improve this Doc View Source

GetColumnName(String, String, String)

生成字段名

Declaration
public virtual string GetColumnName(string prefix, string columnName, string alias)
Parameters
Type Name Description
System.String prefix

前缀

System.String columnName

字段名

System.String alias

字段别名

Returns
Type Description
System.String

字段名

Implements
ISqlDialect.GetColumnName(String, String, String)
| Improve this Doc View Source

GetIdentitySql(String)

生成包含主键条件的获取语句

Declaration
public abstract string GetIdentitySql(string tableName)
Parameters
Type Name Description
System.String tableName

数据库表名

Returns
Type Description
System.String

SQL

Implements
ISqlDialect.GetIdentitySql(String)
| Improve this Doc View Source

GetPagingSql(String, Int32, Int32, IDictionary<String, Object>)

生成分页SQL

Declaration
public abstract string GetPagingSql(string sql, int page, int resultsPerPage, IDictionary<string, object> parameters)
Parameters
Type Name Description
System.String sql

原SQL

System.Int32 page

页索引

System.Int32 resultsPerPage

每页条数

IDictionary<System.String, System.Object> parameters

参数

Returns
Type Description
System.String

新SQL

Implements
ISqlDialect.GetPagingSql(String, Int32, Int32, IDictionary<String, Object>)
| Improve this Doc View Source

GetSetSql(String, Int32, Int32, IDictionary<String, Object>)

生成区间SQL

Declaration
public abstract string GetSetSql(string sql, int firstResult, int maxResults, IDictionary<string, object> parameters)
Parameters
Type Name Description
System.String sql

原SQL

System.Int32 firstResult

起始行数

System.Int32 maxResults

最大条数

IDictionary<System.String, System.Object> parameters

参数

Returns
Type Description
System.String

新SQL

Implements
ISqlDialect.GetSetSql(String, Int32, Int32, IDictionary<String, Object>)
| Improve this Doc View Source

GetTableName(String, String, String)

生成表名

Declaration
public virtual string GetTableName(string schemaName, string tableName, string alias)
Parameters
Type Name Description
System.String schemaName

数据库架构

System.String tableName

数据库表名

System.String alias

数据库表别名

Returns
Type Description
System.String

表名

Implements
ISqlDialect.GetTableName(String, String, String)
| Improve this Doc View Source

IsQuoted(String)

判断语句是否包含引号

Declaration
public virtual bool IsQuoted(string value)
Parameters
Type Name Description
System.String value

语句

Returns
Type Description
System.Boolean

是否包含引号

Implements
ISqlDialect.IsQuoted(String)
| Improve this Doc View Source

QuoteString(String)

语句添加引号

Declaration
public virtual string QuoteString(string value)
Parameters
Type Name Description
System.String value

原语句

Returns
Type Description
System.String

新语句

Implements
ISqlDialect.QuoteString(String)
| Improve this Doc View Source

SelectLimit(String, Int32)

获取前N条的SQL

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

原SQL

System.Int32 limit

指定前几条

Returns
Type Description
System.String

新SQL

Implements
ISqlDialect.SelectLimit(String, Int32)
| Improve this Doc View Source

SetNolock(String)

SQL语句添加 WITH (NOLOCK)

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

SQL语句

Returns
Type Description
System.String

添加后SQL语句

Implements
ISqlDialect.SetNolock(String)
| Improve this Doc View Source

UnQuoteString(String)

Declaration
public virtual string UnQuoteString(string value)
Parameters
Type Name Description
System.String value
Returns
Type Description
System.String

Extension Methods

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