DBDapper 4.2.0
dotnet add package DBDapper --version 4.2.0
NuGet\Install-Package DBDapper -Version 4.2.0
<PackageReference Include="DBDapper" Version="4.2.0" />
paket add DBDapper --version 4.2.0
#r "nuget: DBDapper, 4.2.0"
// Install DBDapper as a Cake Addin #addin nuget:?package=DBDapper&version=4.2.0 // Install DBDapper as a Cake Tool #tool nuget:?package=DBDapper&version=4.2.0
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)
- FastMember (>= 1.5.0)
- 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 | 115 | 7/14/2024 | |
4.1.1 | 123 | 6/23/2024 | |
4.1.0 | 132 | 6/23/2024 | |
4.0.0 | 121 | 6/23/2024 | |
3.0.6 | 130 | 3/28/2024 | |
3.0.5 | 216 | 12/26/2023 | |
3.0.4 | 152 | 12/19/2023 | |
3.0.3 | 133 | 12/19/2023 | |
3.0.2 | 129 | 12/19/2023 | |
3.0.1 | 130 | 12/19/2023 | |
3.0.0 | 137 | 12/19/2023 | |
2.2.0 | 184 | 11/4/2023 | |
2.1.0 | 134 | 11/2/2023 | |
2.0.0 | 238 | 4/4/2023 | |
1.3.0 | 303 | 1/20/2023 | |
1.1.0 | 357 | 10/23/2022 |
.NET 8 ensures compatibility.