DBDapper 3.0.6
See the version list below for details.
dotnet add package DBDapper --version 3.0.6
NuGet\Install-Package DBDapper -Version 3.0.6
<PackageReference Include="DBDapper" Version="3.0.6" />
paket add DBDapper --version 3.0.6
#r "nuget: DBDapper, 3.0.6"
// Install DBDapper as a Cake Addin #addin nuget:?package=DBDapper&version=3.0.6 // Install DBDapper as a Cake Tool #tool nuget:?package=DBDapper&version=3.0.6
DBDapper
Overview
DBDapper
is a utility class for interacting with a SQL Server database using Dapper. It provides convenient methods for executing stored procedures and SQL queries and handling database connections.
Table of Contents
Getting Started
Installation
Using .NET CLI
To install the required packages using .NET CLI, run the following command in the terminal:
dotnet add package DBDapper
Using Package Manager Console
To install the required packages using Package Manager Console, run the following command in the console:
Install-Package DBDapper
Configuration
Make sure to configure your database connection string in the appsettings.json
file:
{
"ConnectionStrings": {
"YourConnectionStringName": "YourActualConnectionStringHere"
}
}
Replace "YourConnectionStringName"
with the desired name and "YourActualConnectionStringHere"
with your actual database connection string.
Usage
Initializing DBDapper
// Create an instance of DBDapper
DBDapper dbDapper = new DBDapper();
// OR specify a connection string from appsettings.json
DBDapper dbDapper = new DBDapper("YourConnectionStringName");
Executing Stored Procedures
Synchronous
// Execute a stored procedure and get the results
List<YourObjectType> results = dbDapper.RunSqlProc<YourObjectType>("YourStoredProcedure", parameters);
Asynchronous
// Execute a stored procedure asynchronously and get the results
List<YourObjectType> results = await dbDapper.RunSqlProcAsync<YourObjectType>("YourStoredProcedure", parameters);
Executing SQL Queries
Synchronous
// Execute a SQL query and get the results
List<YourObjectType> results = dbDapper.RunSqlQuery<YourObjectType>("YourSqlQuery", parameters);
Asynchronous
// Execute a SQL query asynchronously and get the results
List<YourObjectType> results = await dbDapper.RunSqlQueryAsync<YourObjectType>("YourSqlQuery", parameters);
Contributing
If you'd like to contribute to DBDapper
, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure tests pass.
- Submit a pull request.
License
This project is licensed under the terms of the LICENSE.txt file.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net7.0
- Dapper (>= 2.1.35)
- Microsoft.AspNetCore.Routing.Abstractions (>= 2.1.1)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Data.SqlClient (>= 4.8.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 | |
---|---|---|---|
4.2.0 | 105 | 7/14/2024 | |
4.1.1 | 114 | 6/23/2024 | |
4.1.0 | 125 | 6/23/2024 | |
4.0.0 | 115 | 6/23/2024 | |
3.0.6 | 125 | 3/28/2024 | |
3.0.5 | 210 | 12/26/2023 | |
3.0.4 | 148 | 12/19/2023 | |
3.0.3 | 129 | 12/19/2023 | |
3.0.2 | 124 | 12/19/2023 | |
3.0.1 | 124 | 12/19/2023 | |
3.0.0 | 133 | 12/19/2023 | |
2.2.0 | 180 | 11/4/2023 | |
2.1.0 | 130 | 11/2/2023 | |
2.0.0 | 234 | 4/4/2023 | |
1.3.0 | 299 | 1/20/2023 | |
1.1.0 | 353 | 10/23/2022 |
.NET 8 ensures compatibility.