Class SqlServerDialect
SQL Server方言类
Inherited Members
Namespace: DapperDal.Sql
Assembly: DapperDal.dll
Syntax
public class SqlServerDialect : SqlDialectBase, ISqlDialect
Properties
| Improve this Doc View SourceCloseQuote
表示右引号的字符
Declaration
public override char CloseQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
Overrides
| Improve this Doc View SourceOpenQuote
表示左引号的字符
Declaration
public override char OpenQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
Overrides
Methods
| Improve this Doc View SourceGetColumnNames(String)
获取SQL语句里的所有字段名
Declaration
protected virtual IList<string> GetColumnNames(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
IList<System.String> | 字段名列表 |
GetFromStart(String)
获取SQL语句的FROM索引
Declaration
protected int GetFromStart(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
System.Int32 | FROM索引 |
GetIdentitySql(String)
生成包含主键条件的获取语句
Declaration
public override string GetIdentitySql(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | 数据库表名 |
Returns
Type | Description |
---|---|
System.String | SQL |
Overrides
| Improve this Doc View SourceGetOrderByClause(String)
获取SQL语句的排序部分语句
Declaration
protected string GetOrderByClause(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
System.String | 排序部分语句 |
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
| Improve this Doc View SourceGetSelectEnd(String)
获取SQL语句的SELECT索引
Declaration
protected virtual int GetSelectEnd(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
System.Int32 | SELECT索引 |
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
| Improve this Doc View SourceSelectLimit(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
| Improve this Doc View SourceSetNolock(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语句 |