DapperDBHelper 1.3.0
See the version list below for details.
dotnet add package DapperDBHelper --version 1.3.0
NuGet\Install-Package DapperDBHelper -Version 1.3.0
<PackageReference Include="DapperDBHelper" Version="1.3.0" />
paket add DapperDBHelper --version 1.3.0
#r "nuget: DapperDBHelper, 1.3.0"
// Install DapperDBHelper as a Cake Addin #addin nuget:?package=DapperDBHelper&version=1.3.0 // Install DapperDBHelper as a Cake Tool #tool nuget:?package=DapperDBHelper&version=1.3.0
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});
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Dapper (>= 2.0.78)
- Newtonsoft.Json (>= 12.0.3)
- System.Configuration.ConfigurationManager (>= 5.0.0)
- System.Data.Common (>= 4.3.0)
- System.Data.SqlClient (>= 4.8.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.