DBDapper 4.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DBDapper --version 4.1.0                
NuGet\Install-Package DBDapper -Version 4.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DBDapper" Version="4.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DBDapper --version 4.1.0                
#r "nuget: DBDapper, 4.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DBDapper as a Cake Addin
#addin nuget:?package=DBDapper&version=4.1.0

// Install DBDapper as a Cake Tool
#tool nuget:?package=DBDapper&version=4.1.0                

DBDapper NuGet

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:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure tests pass.
  4. Submit a pull request.

License

This project is licensed under the terms of the LICENSE.txt file.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

.NET 8 ensures compatibility.