DASL.DapperWrapper
1.0.2
There is a newer version of this package available.
See the version list below for details.
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net8.0
- Dapper (>= 2.1.35)
- Dapper.Contrib (>= 2.0.78)
- MySql.Data (>= 8.3.0)
- MySqlConnector (>= 2.3.6)
- System.Drawing.Common (>= 8.0.4)
- Z.Dapper.Plus (>= 7.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed name spaces and updated nuget packages