DapperDBHelper NuGet Package

Use full for web API’s
Excludes the installation of extra packages just installs DapperDBHelper and create object of DapperDBHelper and pass your connection string through contractor DBHelper class.
How we can use DapperDBHelper, Find the piece of code below Example
public class SetupsController
{
private readonly DBHelpers _dBHelpers;
public SetupsController()
{
_dBHelpers = new DBHelpers(ConectionString.connectionString);
}
Public async void getSingleList()
{
var Result = await _dBHelpers.QueryAsyncList<YourViewModelClass>("Select * from table");
}
public void getSingleRecord()
{
var Result = _dBHelpers.Query<YourViewModelClass>("Select Top 1* from table");
}

public void getMultipleTable()
{
Make list same as it is like table returns from your store procedure
List<string> tableName = new List<string>();
tableName.Add("Table1");
tableName.Add("Table2");
tableName.Add("Table3");

var Result = await _dBHelpers.QueryMultipleAsync("EXEC Store_Procedure @ID", param: new { ID = ID }, tableName);
}
Execute Method is used for CRUD Operations
After Execution of your store procedure returning single row of current execution is best practice
ExecuteAsync call depends upon your application nature
public void InserData(Employees model)
{
var Result = await _dBHelpers.Execute("EXEC Store_Procedure @FirstName,@LastName,@Address", param: new { FirstName = model.FirstName, LastName =model.LastName, Address = model.Address});
}.




Got any DapperDBHelper Question?





Info

Version: 1.4.0
Author(s): DapperDBHelper
Last Update: Tuesday, August 2, 2022
.NET Fiddle: Create the first Fiddle
NuGet Url: https://www.nuget.org/packages/DapperDBHelper


Install
Install-Package DapperDBHelper
dotnet add package DapperDBHelper
paket add DapperDBHelper
DapperDBHelper Download (Unzip the "nupkg" after downloading)



Tags



STATS

must-have-score

1.3

avg-downloads-per-day

0

days-since-last-release

639