MicroORM.MySQL
1.0.0.1
dotnet add package MicroORM.MySQL --version 1.0.0.1
NuGet\Install-Package MicroORM.MySQL -Version 1.0.0.1
<PackageReference Include="MicroORM.MySQL" Version="1.0.0.1" />
paket add MicroORM.MySQL --version 1.0.0.1
#r "nuget: MicroORM.MySQL, 1.0.0.1"
// Install MicroORM.MySQL as a Cake Addin #addin nuget:?package=MicroORM.MySQL&version=1.0.0.1 // Install MicroORM.MySQL as a Cake Tool #tool nuget:?package=MicroORM.MySQL&version=1.0.0.1
MicroORM.MySQL : Overview
A high-performance Micro-ORM supporting MySQL Server database. This is the extension of the dapper version for easy to configure and use.
Features
Query
QueryAsync
QueryFirst
QueryFirstAsync
QuerySingle
QuerySingleAsync
QueryFirstOrDefault
QueryFirstOrDefaultAsync
QuerySingleOrDefault
QuerySingleOrDefaultAsync
QueryMultiple
QueryMultipleAsync
Execute
ExecuteAsync
ExecuteReader
ExecuteReaderAsync
ExecuteScalar
ExecuteScalarAsync
How to use
You can configure this package in two ways. I will explain both two ways. you can use your suitable one.
One
You have to create a new class like ApplicationDbContext inherited from the DatabaseContext class that comes from this library. you have to add using MicroORM.MySQL; namespace.
public class ApplicationDbContext:DatabaseContext
{
public ApplicationDbContext():base("DatabaseConnectionString")
{
}
}
Controller code sample.
[ApiController]
[Route("[controller]/[action]")]
public class TestController : ControllerBase
{
[HttpGet]
public IActionResult GetAll()
{
ApplicationDbContext dbContext = new ApplicationDbContext ();
var data= dbContext.Query<ReturnType>("Query").ToList();
return Ok(data);
}
}
Two
If you use dependency injection then this option is for you.
using MicroORM.SQL;
builder.Services.AddDatabaseContext(options =>
{
options.ConnectionString = "DatabaseConnectionString"
});
Controller code sample.
[ApiController]
[Route("[controller]/[action]")]
public class TestController : ControllerBase
{
ApplicationDbContext _dbContext;
public TestController(ApplicationDbContext dbContext)
{
_dbContext=dbContext;
}
[HttpGet]
public IActionResult GetAll()
{
var data= _dbContext.Query<ReturnType>("Query").ToList();
return Ok(data);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.1
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- MySql.Data (>= 8.0.32.1)
-
.NETFramework 4.6.1
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- MySql.Data (>= 8.0.32.1)
-
net5.0
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- MySql.Data (>= 8.0.32.1)
-
net6.0
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- MySql.Data (>= 8.0.32.1)
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.0.0.1 | 231 | 11/19/2023 |