Class SqlServerTools
- Namespace
- LinqToDB.DataProvider.SqlServer
- Assembly
- linq2db.dll
public static class SqlServerTools
- Inheritance
-
SqlServerTools
Properties
DefaultBulkCopyType
[Obsolete("Use SqlServerOptions.Default.BulkCopyType instead.")]
public static BulkCopyType DefaultBulkCopyType { get; set; }
Property Value
Methods
AsSqlServer<TSource>(ITable<TSource>)
[Sql.QueryExtension(null, Sql.QueryExtensionScope.None, typeof(NoneExtensionBuilder))]
public static ISqlServerSpecificTable<TSource> AsSqlServer<TSource>(this ITable<TSource> table) where TSource : notnull
Parameters
table
ITable<TSource>
Returns
- ISqlServerSpecificTable<TSource>
Type Parameters
TSource
AsSqlServer<TSource>(IQueryable<TSource>)
[Sql.QueryExtension(null, Sql.QueryExtensionScope.None, typeof(NoneExtensionBuilder))]
public static ISqlServerSpecificQueryable<TSource> AsSqlServer<TSource>(this IQueryable<TSource> source) where TSource : notnull
Parameters
source
IQueryable<TSource>
Returns
- ISqlServerSpecificQueryable<TSource>
Type Parameters
TSource
CreateDataConnection(DbConnection, SqlServerVersion, SqlServerProvider)
public static DataConnection CreateDataConnection(DbConnection connection, SqlServerVersion version = SqlServerVersion.AutoDetect, SqlServerProvider provider = SqlServerProvider.AutoDetect)
Parameters
connection
DbConnectionversion
SqlServerVersionprovider
SqlServerProvider
Returns
CreateDataConnection(DbTransaction, SqlServerVersion, SqlServerProvider)
public static DataConnection CreateDataConnection(DbTransaction transaction, SqlServerVersion version = SqlServerVersion.AutoDetect, SqlServerProvider provider = SqlServerProvider.AutoDetect)
Parameters
transaction
DbTransactionversion
SqlServerVersionprovider
SqlServerProvider
Returns
CreateDataConnection(string, SqlServerVersion, SqlServerProvider)
public static DataConnection CreateDataConnection(string connectionString, SqlServerVersion version = SqlServerVersion.AutoDetect, SqlServerProvider provider = SqlServerProvider.AutoDetect)
Parameters
connectionString
stringversion
SqlServerVersionprovider
SqlServerProvider
Returns
DetectServerVersion(SqlServerProvider, string)
Connects to SQL Server Database and parses version information.
public static SqlServerVersion? DetectServerVersion(SqlServerProvider provider, string connectionString)
Parameters
provider
SqlServerProviderconnectionString
string
Returns
- SqlServerVersion?
Detected SQL Server version.
GetDataProvider(SqlServerVersion, SqlServerProvider, string?)
public static IDataProvider GetDataProvider(SqlServerVersion version = SqlServerVersion.AutoDetect, SqlServerProvider provider = SqlServerProvider.AutoDetect, string? connectionString = null)
Parameters
version
SqlServerVersionprovider
SqlServerProviderconnectionString
string
Returns
QuoteIdentifier(string)
public static string QuoteIdentifier(string identifier)
Parameters
identifier
string
Returns
ResolveSqlTypes(Assembly)
Registers spatial types assembly (Microsoft.SqlServer.Types). Also check https://linq2db.github.io/articles/FAQ.html#how-can-i-use-sql-server-spatial-types for additional required configuration steps.
public static void ResolveSqlTypes(Assembly assembly)
Parameters
assembly
Assembly
ResolveSqlTypes(string)
Tries to load and register spatial types using provided path to types assembly (Microsoft.SqlServer.Types). Also check https://linq2db.github.io/articles/FAQ.html#how-can-i-use-sql-server-spatial-types for additional required configuration steps.
public static void ResolveSqlTypes(string path)
Parameters
path
string