![]() |
VOOZH | about |
dotnet add package Net4x.DapperLibrary.SqlServer --version 1.9.9.8
NuGet\Install-Package Net4x.DapperLibrary.SqlServer -Version 1.9.9.8
<PackageReference Include="Net4x.DapperLibrary.SqlServer" Version="1.9.9.8" />
<PackageVersion Include="Net4x.DapperLibrary.SqlServer" Version="1.9.9.8" />Directory.Packages.props
<PackageReference Include="Net4x.DapperLibrary.SqlServer" />Project file
paket add Net4x.DapperLibrary.SqlServer --version 1.9.9.8
#r "nuget: Net4x.DapperLibrary.SqlServer, 1.9.9.8"
#:package Net4x.DapperLibrary.SqlServer@1.9.9.8
#addin nuget:?package=Net4x.DapperLibrary.SqlServer&version=1.9.9.8Install as a Cake Addin
#tool nuget:?package=Net4x.DapperLibrary.SqlServer&version=1.9.9.8Install as a Cake Tool
SQL Server provider-specific extensions for DapperLibrary. This project contains the SQL Server concrete SqlDapperContext, the SqlProviderFactory and SQL Server specific database model types and helpers such as restore-from-backup extensions.
Provide SQL Server engine-specific behavior and defaults while keeping the DapperLibrary public API consistent across providers. This includes:
SqlDapperContext that wires SQL Server-specific defaults into DapperContext.SqlProviderFactory that configures data adapter behavior, parameter handling and row update events.SqlDatabaseModel with SQL Server delimiters, parameter prefix and type mappings.RestoreDatabaseFromBackupAsync).SqlDapperContext � derived DapperContext configured for SQL Server. Convenience static Use / UseOnce methods register a ContextCreator that sets SQL Server defaults (for instance IdentityInitializer and FormatDatetimeAsString). Constructors accept DapperConnectionStringSettings or IConfiguration.
SqlProviderFactory � provider factory based on the underlying SQL client factory (System.Data.SqlClient on older frameworks or Microsoft.Data.SqlClient on newer). It sets ParameterModel.AddIndex = true and installs a PrepareCommandParameters delegate. It also exposes row-updating/updated event raising hooks.
SqlDatabaseModel � implements DatabaseModel specifics for SQL Server (begin/end delimiters [ / ], batch separator GO, parameter prefix @, and SQL Server-specific type mappings).
RestoreExtension � utility extension providing RestoreDatabaseFromBackupAsync which reads backup logical names, computes file move clauses and executes a restore statement. It demonstrates safe closing of open readers and connections and updates the context's active connection string to point at the restored database.
Create and use a SqlDapperContext as you would a DapperContext, or use the static helpers to wire convenient context creation:
// Simple: create from defaults
using var context = new SqlDapperContext();
// Register usage factory in bootstrap code
SqlDapperContext.Use();
// Use a single use creator with explicit connection string
SqlDapperContext.UseOnce(connectionString, providerName);
Customize identity and datetime formatting when using the static helpers (these are set automatically by the Use helpers):
// The created context will have: DatabaseModel.IdentityInitializer = "IDENTITY(int, 1, 1)"
// and a FormatDatetimeAsString that produces CONVERT(datetime, '...') SQL compatible with SQL Server.
Restore database example:
await context.RestoreDatabaseFromBackupAsync("MyNewDb", @"C:\Backups\mydb.bak");
Restore will close any open readers and connections used by the DapperContext and update the context's ConnectionStringSettings to point to the restored database.
NET35, NET40, NET45, NET461, etc.) the project uses System.Data.SqlClient.Microsoft.Data.SqlClient.SqlDapperContext and the underlying DapperContext expose both synchronous and asynchronous operations. Use the Async-suffixed methods for non-blocking I/O (for example GetDataReaderAsync, SetDataAsync, GetDataTableAsync).RestoreDatabaseFromBackupAsync is implemented as an async operation and uses async reader/close patterns where available; conditional compilation guards are present to handle frameworks that do not expose certain CloseAsync or ReadAsync APIs.SqlProviderFactory.CreateDataAdapter attaches to RowUpdated/RowUpdating events and forwards them via the provider factory's raised events. This allows consumer code to react to row update lifecycle events when using DbDataAdapter operations (for example when using SaveDataTable).Use / UseOnce static helpers when wiring SQL Server contexts�these helpers preconfigure common SQL Server behaviors.For further details consult the source files in DbContexts and Extensions directories.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net35 net35 is compatible. net40 net40 is compatible. net403 net403 was computed. net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Net4x.DapperLibrary.SqlServer:
| Package | Downloads |
|---|---|
|
Net4x.DapperLibrary.MockSqlServer
Package Description |
|
|
Net4x.DapperLibrary.Docker
Package Description |
|
|
Net4x.EntityFramework.Library
Package Description |
|
|
Net4x.Xsd2Db.Data
Package Description |
|
|
Net4x.Windows.Library
WindowsLibrary |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.9.8 | 261 | 2/2/2026 |
| 1.9.9.7 | 373 | 1/13/2026 |
| 1.9.9.6 | 257 | 1/6/2026 |
| 1.9.9.5 | 270 | 1/6/2026 |
| 1.9.9.4 | 265 | 1/6/2026 |
| 1.9.9.3 | 370 | 1/5/2026 |
| 1.9.9.2 | 252 | 12/30/2025 |
| 1.9.9.1 | 286 | 12/30/2025 |
| 1.9.9 | 340 | 12/22/2025 |
| 1.6.0.12 | 312 | 12/12/2025 |
| 1.6.0.11 | 306 | 12/12/2025 |
| 1.6.0.10 | 611 | 12/9/2025 |
| 1.6.0.9 | 272 | 12/4/2025 |
| 1.6.0.8 | 280 | 12/4/2025 |
| 1.6.0.7 | 339 | 11/30/2025 |
| 1.6.0.6 | 267 | 11/27/2025 |
| 1.6.0.5 | 345 | 11/22/2025 |
| 1.6.0.4 | 226 | 11/16/2025 |
| 1.6.0.3 | 266 | 11/15/2025 |
| 1.6.0.2 | 403 | 11/14/2025 |