TypedParameters.Dapper.SqlServer
1.2.0
dotnet add package TypedParameters.Dapper.SqlServer --version 1.2.0
NuGet\Install-Package TypedParameters.Dapper.SqlServer -Version 1.2.0
<PackageReference Include="TypedParameters.Dapper.SqlServer" Version="1.2.0" />
<PackageVersion Include="TypedParameters.Dapper.SqlServer" Version="1.2.0" />
<PackageReference Include="TypedParameters.Dapper.SqlServer" />
paket add TypedParameters.Dapper.SqlServer --version 1.2.0
#r "nuget: TypedParameters.Dapper.SqlServer, 1.2.0"
#:package TypedParameters.Dapper.SqlServer@1.2.0
#addin nuget:?package=TypedParameters.Dapper.SqlServer&version=1.2.0
#tool nuget:?package=TypedParameters.Dapper.SqlServer&version=1.2.0
TypedParameters.Dapper.SqlServer
Explicitly typed SQL Server parameters for Dapper using Microsoft.Data.SqlClient.
Installation
dotnet add package TypedParameters.Dapper.SqlServer
Why use it?
Dapper parameter inference is convenient, but the provider metadata sent to SQL Server is not always obvious at the call site. This package lets code declare the known SQL Server parameter contract explicitly while preserving ordinary Dapper usage.
Quick start
using Dapper;
using Dapper.TypedParameters.SqlServer;
using Microsoft.Data.SqlClient;
await using var connection = new SqlConnection(connectionString);
var customer = await connection.QuerySingleOrDefaultAsync<Customer>(
"""
SELECT Id, Document, Name
FROM dbo.Customers
WHERE Document = @Document;
""",
new
{
Document = SqlParam.VarChar(document, 11)
});
Supported parameter types
| Family | Factories and metadata |
|---|---|
| Strings | VarChar, NVarChar, Char, NChar, VarCharMax, NVarCharMax |
| Numeric | Bit, TinyInt, SmallInt, Int, BigInt, Real, Float, Decimal, Money, SmallMoney |
| Binary / identifiers | UniqueIdentifier, Binary, VarBinary, VarBinaryMax |
| Temporal | Date, Time, DateTime, SmallDateTime, DateTime2, DateTimeOffset |
| Output parameters | AsOutput(), AsInputOutput(), OutputValue, GetValue<T>() |
| Table-valued parameters | TableValued(typeName, dataTable) |
Explicit parameter metadata
TypedParameters.Dapper.SqlServer declares SQL Server metadata directly on the SqlParameter that Dapper materializes:
SqlDbTypeSizePrecisionScaleDirection
Output parameters
Scalar parameters can be converted to output or input/output parameters with AsOutput() and AsInputOutput(). Keep the same typed parameter instance that is passed to Dapper, then read OutputValue or GetValue<T>() after command execution completes.
Table-valued parameters
SqlParam.TableValued(typeName, dataTable) sends a SQL Server Structured parameter. The caller provides the DataTable and the name of an existing SQL Server user-defined table type. This package does not create table types, inspect schema, or map POCOs to DataTable.
Compatibility
net8.0net10.0- Dapper
Microsoft.Data.SqlClient
What this package does not do
This package does not inspect database schema, query metadata, rewrite SQL, analyze execution plans, detect implicit conversions, choose SQL types automatically, create user-defined table types, map POCOs to table-valued parameters, or support System.Data.SqlClient.
Documentation
See the repository README and full documentation in the repository docs/ directory.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Dapper (>= 2.1.79)
- Microsoft.Data.SqlClient (>= 6.1.6)
-
net8.0
- Dapper (>= 2.1.79)
- Microsoft.Data.SqlClient (>= 6.1.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 91 | 8/29/2026 |
| 1.0.2 | 98 | 8/27/2026 |
| 1.0.1 | 85 | 8/24/2026 |
| 1.0.0 | 131 | 8/11/2026 |
| 1.0.0-rc.1 | 249 | 8/11/2026 |
| 0.1.0-preview.1 | 80 | 8/10/2026 |