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
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="MicroORM.SQL" Version="1.0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MicroORM.SQL --version 1.0.0.2
#r "nuget: MicroORM.SQL, 1.0.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 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 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. 
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.0.0.2 216 11/14/2023
1.0.0.1 100 11/14/2023