All Projects → vb-consulting → Norm.net

vb-consulting / Norm.net

Licence: MIT license
High performance micro-ORM modern Dapper replacement for .NET Standard 2.1 and higher

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Norm.net

aliyun-openapi-sdk-net-core
aliyun open api sdk for .net core 2.0
Stars: ✭ 17 (-81.52%)
Mutual labels:  netcore, net
Singularity
A extremely fast ioc container for high performance applications
Stars: ✭ 63 (-31.52%)
Mutual labels:  netcore, net
Zkweb
A flexible web framework supports .Net Framework and .Net Core
Stars: ✭ 475 (+416.3%)
Mutual labels:  netcore, net
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+3496.74%)
Mutual labels:  netcore, net
Anndotnet
ANNdotNET - deep learning tool on .NET Platform.
Stars: ✭ 109 (+18.48%)
Mutual labels:  netcore, net
Dbreeze
C# .NET MONO NOSQL ( key value store embedded ) ACID multi-paradigm database management system.
Stars: ✭ 383 (+316.3%)
Mutual labels:  netcore, net
Cookedrabbit
CookedRabbit is a simple service based RabbitMQ wrapper for dealing with channels/connections.
Stars: ✭ 28 (-69.57%)
Mutual labels:  netcore, net
DotNetDynamicInjector
💉 Dynamically reference external dlls without the need to add them to the project. Leave your project with low dependency and allowing specific dlls according to your business rule or database parameters.
Stars: ✭ 18 (-80.43%)
Mutual labels:  netcore, net
Saas Vuejs Tailwindcss
VueJS + TailwindCSS frontend for SaaS apps.
Stars: ✭ 107 (+16.3%)
Mutual labels:  netcore, net
Filecontextcore
FileContextCore is a "Database"-Provider for Entity Framework Core and adds the ability to store information in files instead of being limited to databases.
Stars: ✭ 91 (-1.09%)
Mutual labels:  netcore, net
H.NotifyIcon.WPF
NotifyIcon for .Net Core 3.1 and .Net 5 WPF.
Stars: ✭ 44 (-52.17%)
Mutual labels:  netcore, net
Mqttnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 2,486 (+2602.17%)
Mutual labels:  netcore, net
Sharer
Arduino & .NET serial communication library to read/write variables and remote call functions using the Sharer protocol. Works on Windows, Linux and MacOS.
Stars: ✭ 21 (-77.17%)
Mutual labels:  netcore, net
Bcrypt.net
BCrypt.Net - Bringing updates to the original bcrypt package
Stars: ✭ 422 (+358.7%)
Mutual labels:  netcore, net
ormdb
ORM tool for .Net / .Net.Core
Stars: ✭ 14 (-84.78%)
Mutual labels:  netcore, net
Epplus
EPPlus 5-Excel spreadsheets for .NET
Stars: ✭ 693 (+653.26%)
Mutual labels:  netcore, net
NETProvider
Firebird ADO.NET Data Provider
Stars: ✭ 113 (+22.83%)
Mutual labels:  netcore, net
live-documenter
.NET documentation generator and live reader. Generate documentation from .NET code and xml comments, fast, quick and easy.
Stars: ✭ 64 (-30.43%)
Mutual labels:  netcore, net
Localization
🌏 Database Resource Localization for .NET Core with Entity Framework and In Memory Cache
Stars: ✭ 68 (-26.09%)
Mutual labels:  netcore, net
Raft.net
Implementation of RAFT distributed consensus algorithm among TCP Peers on .NET / .NETStandard / .NETCore / dotnet
Stars: ✭ 112 (+21.74%)
Mutual labels:  netcore, net

Norm Micro-ORM

High performance micro-ORM database mapper and modernized Dapper replacement for .NET Standard 2.1 and higher

build-test-publish

Features at a Glance

High-performance mapping

  • Outstanding perfomances. See benchmarsks here
  • Build an iterator over database reader to avoid unnecessary iterations.
  • Use asynchronous streaming directly from the database.

Powerful and extendible mapping system

  • Map up to 12 instances from the same command.
  • Map to simple values, tuples, named tuples, anonymous types, whatever you need. Not every query deserves a class.
  • Map to arrays and other exotic types available on databases such as PostgreSQL.
  • Implement your custom mapping logic to handle custom types such as geometry types from PostGIS.

Some examples:

At least three things that Norm data access for .NET can do - but Dapper can't:

Advanced logging and analytics:

You can configure Norm to automatically add a comment header to all your commands that will contain stuff like:

  1. Caller info containing calling method name and source code file name with exact line number.
  2. Full parameter list containing parameter name, type, and value.

Why we would ever want to do this?

This is very useful debugging info that:

  1. Will be visible in your console if we add a logging callback (see example). You can actually use Ctrl+Click in your Visual Studio Code to navigate to that source line instantly.
  2. Will be visible in your database monitoring tools like Activity Monitor for SQL Server or pg_stat_activity on PostgreSQL, since it is just a command comment header.

How to build a nested objects tree from a multiple tables join query - Norm vs Dapper comparison:

The goal is to map query results to an object tree, where each Shop object from the list has a collection of Account objects and each Account object has a reference to a Shop object to whom it belongs, and so on.

Norm works differently from Dapper.

Norm builds an iterator over the data reader which means that the read operation will not start until the iteration is triggered (ToList in this example).

That means that we can build a Linq expression tree before we start with the iteration and it will still iterate and read data only once.

On another hand, Dapper accepts the lambda function as a parameter that allows you to build the object tree using lookups.

I think that the Norm version is cleaner, more elegant, more flexible, and faster.

Usage

Get it on Nuget

> dotnet add package Norm.net

Use in project

using Norm;
using System.Linq;
 
// Start using database connection extensions:
 
// Map results to record
var records = connection.Read<MyRecord>("select id, foo, bar from table");
 
// Map results to class
var classes = connection.Read<MyClass>("select id, foo, bar from table");
 
// Map single values to a tuple and deconstruct to three variables
var (id, foo, bar) = connection.Read<int, string, string>("select id, foo, bar from table").Single();
 
// Map to a named tuple (id, foo, bar):
var tuple = connection.Read<(int id, string foo, string bar)>("select id, foo, bar from table").Single();
 
// Asynchronously stream values directly from database
await foreach(var (id, foo, bar) in connection.ReadAsync<int, string, string>("select id, foo, bar from table"))
{
    //...
}

//anonymous type instance
var instance = connection.Read(new { id = default(int), foo = default(string), bar = default(string) }, "select id, foo, bar from table").Single();

// Asynchronously stream to anonymous types directly from database
await foreach(var i in connection.ReadAsync(new 
{ 
    id = default(int), 
    foo = default(string), 
    bar = default(string) 
}, "select id, foo, bar from table"))
{
    //...
}
 
// etc...

Currently supported platforms

  • .NET Standard 2.1

Support

This is open-source software developed and maintained freely without any compensation whatsoever.

Licence

Copyright (c) Vedran Bilopavlović - VB Consulting and VB Software 2020 This source code is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].