MicroORM.SQL
1.0.0.2
dotnet add package MicroORM.SQL --version 1.0.0.2
NuGet\Install-Package MicroORM.SQL -Version 1.0.0.2
<PackageReference Include="MicroORM.SQL" Version="1.0.0.2" />
paket add MicroORM.SQL --version 1.0.0.2
#r "nuget: MicroORM.SQL, 1.0.0.2"
// Install MicroORM.SQL as a Cake Addin #addin nuget:?package=MicroORM.SQL&version=1.0.0.2 // Install MicroORM.SQL as a Cake Tool #tool nuget:?package=MicroORM.SQL&version=1.0.0.2
MicroORM.SQL : Overview
A high-performance Micro-ORM supporting SQL 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.SQL; 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)
- System.Data.SqlClient (>= 4.8.5)
-
.NETFramework 4.6.1
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- System.Data.SqlClient (>= 4.8.5)
-
net5.0
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- System.Data.SqlClient (>= 4.8.5)
-
net6.0
- Dapper (>= 2.0.123)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- System.Data.SqlClient (>= 4.8.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.