DBDapper 3.0.4
See the version list below for details.
dotnet add package DBDapper --version 3.0.4
NuGet\Install-Package DBDapper -Version 3.0.4
<PackageReference Include="DBDapper" Version="3.0.4" />
paket add DBDapper --version 3.0.4
#r "nuget: DBDapper, 3.0.4"
// Install DBDapper as a Cake Addin #addin nuget:?package=DBDapper&version=3.0.4 // Install DBDapper as a Cake Tool #tool nuget:?package=DBDapper&version=3.0.4
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.24)
- Microsoft.AspNetCore.Routing.Abstractions (>= 2.1.1)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Data.SqlClient (>= 4.8.5)
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 | 107 | 7/14/2024 | |
4.1.1 | 116 | 6/23/2024 | |
4.1.0 | 127 | 6/23/2024 | |
4.0.0 | 117 | 6/23/2024 | |
3.0.6 | 127 | 3/28/2024 | |
3.0.5 | 212 | 12/26/2023 | |
3.0.4 | 150 | 12/19/2023 | |
3.0.3 | 131 | 12/19/2023 | |
3.0.2 | 126 | 12/19/2023 | |
3.0.1 | 126 | 12/19/2023 | |
3.0.0 | 135 | 12/19/2023 | |
2.2.0 | 182 | 11/4/2023 | |
2.1.0 | 132 | 11/2/2023 | |
2.0.0 | 236 | 4/4/2023 | |
1.3.0 | 301 | 1/20/2023 | |
1.1.0 | 355 | 10/23/2022 |