DASL.DapperWrapper 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package DASL.DapperWrapper --version 1.0.2                
NuGet\Install-Package DASL.DapperWrapper -Version 1.0.2                
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="DASL.DapperWrapper" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DASL.DapperWrapper --version 1.0.2                
#r "nuget: DASL.DapperWrapper, 1.0.2"                
#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 DASL.DapperWrapper as a Cake Addin
#addin nuget:?package=DASL.DapperWrapper&version=1.0.2

// Install DASL.DapperWrapper as a Cake Tool
#tool nuget:?package=DASL.DapperWrapper&version=1.0.2                

Usage:

Setup connection string in App.config and specifiy the name before making any calls to DapperWrapper.

DapperWrapper.ConnectionStringName = "my_db_connection";

Assuming this class...

public class User
{
    public int Id { get; set; }
    public string AccountCode { get; set; } = string.Empty;
    public string Email { get; set; }  = string.Empty;
    public string Department { get; set; }  = string.Empty;
    public string AccountPassword { get; set; } = string.Empty;
}

var user1 = new User {....};

int new_id = DapperWrapper.Insert(user1);
int new_id = await DapperWrapper.InsertAsync(user1);

DapperWrapper.Update(user1);
await DapperWrapper.UpdateAsync(user1);

DapperWrapper.Delete(user1);

List<User> users = await DapperWrapper.GetAllByKeyField<User>("Department", "IT");

var user = DapperWrapper.GetByKeyField<User>("AccountEmail", email);

var user = DapperWrapper.Get<User>(23);
var user = await DapperWrapper.GetAsync<User>(23);

var sql = "SELECT * FROM `user` WHERE Email=@email AND AccountPassword  =@password";
var user = return await DapperWrapper.ExecuteSelectSingleAsync<User>(sql, new { email, password });

This version only supports MySQL database. A future version will soon address this.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.

Version Downloads Last updated
1.2.6 68 11/13/2024
1.2.5 82 9/23/2024
1.2.4 78 8/2/2024
1.2.3 97 6/20/2024
1.2.2 104 5/21/2024
1.2.1 118 4/27/2024
1.2.0 114 4/21/2024
1.0.3 106 4/21/2024
1.0.2 118 4/20/2024
1.0.1 101 4/19/2024
1.0.0 99 4/19/2024

Fixed name spaces and updated nuget packages