Show / Hide Table of Contents

Class SqlServerDialect

SQL Server方言类

Inheritance
System.Object
SqlDialectBase
SqlServerDialect
Inherited Members
SqlDialectBase.BatchSeperator
SqlDialectBase.SupportsMultipleStatements
SqlDialectBase.ParameterPrefix
SqlDialectBase.EmptyExpression
SqlDialectBase.GetTableName(String, String, String)
SqlDialectBase.GetColumnName(String, String, String)
SqlDialectBase.IsQuoted(String)
SqlDialectBase.QuoteString(String)
SqlDialectBase.UnQuoteString(String)
Namespace: DapperDal.Sql
Assembly: DapperDal.dll
Syntax
public class SqlServerDialect : SqlDialectBase, ISqlDialect

Properties

| Improve this Doc View Source

CloseQuote

表示右引号的字符

Declaration
public override char CloseQuote { get; }
Property Value
Type Description
System.Char
Overrides
SqlDialectBase.CloseQuote
| Improve this Doc View Source

OpenQuote

表示左引号的字符

Declaration
public override char OpenQuote { get; }
Property Value
Type Description
System.Char
Overrides
SqlDialectBase.OpenQuote

Methods

| Improve this Doc View Source

GetColumnNames(String)

获取SQL语句里的所有字段名

Declaration
protected virtual IList<string> GetColumnNames(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
IList<System.String>

字段名列表

| Improve this Doc View Source

GetFromStart(String)

获取SQL语句的FROM索引

Declaration
protected int GetFromStart(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
System.Int32

FROM索引

| Improve this Doc View Source

GetIdentitySql(String)

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

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

数据库表名

Returns
Type Description
System.String

SQL

Overrides
SqlDialectBase.GetIdentitySql(String)
| Improve this Doc View Source

GetOrderByClause(String)

获取SQL语句的排序部分语句

Declaration
protected string GetOrderByClause(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
System.String

排序部分语句

| Improve this Doc View Source

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

生成分页SQL

Declaration
public override 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

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

GetSelectEnd(String)

获取SQL语句的SELECT索引

Declaration
protected virtual int GetSelectEnd(string sql)
Parameters
Type Name Description
System.String sql

SQL语句

Returns
Type Description
System.Int32

SELECT索引

| Improve this Doc View Source

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

生成区间SQL

Declaration
public override 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

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

SelectLimit(String, Int32)

获取前N条的SQL

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

原SQL

System.Int32 limit

指定前几条

Returns
Type Description
System.String

新SQL

Overrides
SqlDialectBase.SelectLimit(String, Int32)
| Improve this Doc View Source

SetNolock(String)

SQL语句添加 WITH (NOLOCK)

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

SQL语句

Returns
Type Description
System.String

添加后SQL语句

Overrides
SqlDialectBase.SetNolock(String)

Extension Methods

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