Nzr.Orm.Core 0.3.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nzr.Orm.Core --version 0.3.1
NuGet\Install-Package Nzr.Orm.Core -Version 0.3.1
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="Nzr.Orm.Core" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nzr.Orm.Core --version 0.3.1
#r "nuget: Nzr.Orm.Core, 0.3.1"
#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 Nzr.Orm.Core as a Cake Addin
#addin nuget:?package=Nzr.Orm.Core&version=0.3.1

// Install Nzr.Orm.Core as a Cake Tool
#tool nuget:?package=Nzr.Orm.Core&version=0.3.1

Nzr.Orm

Fast, simple, convention-based (but configurable) and extensible Micro-Orm

Key features:

Nzr.Orm is a NuGet library that you can add in to your project providing the following features.

  • CRUD Operations based on object properties: Insert, Select, Update and Delete
  • Aggregate Functions based on object properties: Max, Min, Count, Sum, Avg
  • Attributes to overridade table name and colum names. If not provided, the elements will be mapped as lower_case names.
  • Support to schema: global for the DAO instance or defined for each table using attributes.
  • Support to convert strings to dynamic XML or JSON objects, allowing Characteristics = "<characteristic><brand>NZR</brand></characteristic>" product.Characteristics.characteristic.brand.ToString()

How to use

More examples about how to use it cab be found at HowToUse and Test Project.

USINGS

using Nzr.Orm.Core;
using static Nzr.Orm.Core.Sql.Aggregate;
using static Nzr.Orm.Core.Sql.Where;
using static Nzr.Orm.Core.Utils.Alias;
INSERT

State state = new State() { Name = "CA" };

using (Dao dao = new Dao(transaction, options))
{
	int affectedRows = dao.Insert(state);
}
SELECT

using (Dao dao = new Dao(transaction, options))
{
	State state = dao.Select<State>(123);
}

using (Dao dao = new Dao(transaction, options))
{
	// IList<State> states = dao.Select<State>(new Where { { "Name", Where.EQ "CA" } });
	// IList<State> states = dao.Select<State>(Where("Name", EQ, "CA"));
	IList<State> states = dao.Select<State>(Where("Name", "CA"));
}
UPDATE

state.Name = "WA";
using (Dao dao = new Dao(transaction, options))
{
	int result = dao.Update(state));
}

using (Dao dao = new Dao(transaction, options))
{
    int result = dao.Update<State>(Set("Name", "NY"), Where("Name", "WA").And("Description", IS_NOT, null));
}

DELETE

using (Dao dao = new Dao(transaction, options))
{
	int result = dao.Delete(state));
}

using (Dao dao = new Dao(connectionStrings))
{
	int result = dao.Delete<State>(Where("Name", NE, "CA"));
}
AGGREGATE

using (Dao dao = new Dao(connectionStrings))
{
	int result = dao.Aggregate<State, int>(Aggregate(COUNT, "Id"));
}

Changeset

NOTE: Please wait until version v.1.x.x is released to use this project in production.

All notable changes to this project will be documented in this file.

v0.1.0

Added support to following operations:

  • int Insert(object entity)
  • T Select<T>(int id)
  • T Select<T>(Guid id)
  • T Select<T>(object[] ids)
  • IList<T> Select<T>(Where where)
  • int Update(object entity)
  • int Update<T>(Set set, Where where)
  • int Delete(object entity)
  • int Delete<T>(Where where)
  • U Aggregate<T,U>(Aggregate aggregate, Where where)
v0.2.0

Add support to transactions.

v0.3.0

Multi Mapping and Foreing Keys (Select only)

v0.3.1

Important bug fixed

Added support to alias (using static) to reduce the code typing on Set, Where and Aggregate functions. See: HowToUse

Upcoming features!

v.0.4.0

Add Order By support. Add support to inject Logger.

v.0.5.0

Add support to raw sql.

v0.6.0

Add Where("Column", "Value").Or("Column", "Value") support Add support to Multi Mapping and Foreing Keys for Update and Delete

Know Issues

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 netcoreapp2.2 is compatible.  netcoreapp3.0 was computed.  netcoreapp3.1 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
0.7.4 634 11/13/2019
0.7.2 441 11/5/2019
0.7.1 459 10/20/2019
0.7.0 464 9/29/2019
0.6.3 472 9/26/2019
0.6.2 464 9/23/2019
0.6.1 479 9/17/2019
0.6.0 473 9/16/2019
0.4.1 474 9/13/2019
0.4.0 480 9/12/2019
0.3.1 445 9/11/2019
0.3.0 493 9/9/2019
0.1.0 468 9/4/2019

# Nzr.Orm
Fast, simple, convention-based (but configurable) and extensible Micro-Orm.
NOTE: Please wait until v.1.x.x to use this project in a production.

## Changeset
All notable changes to this project will be documented in this file

###### v.0.1.0
Added support to following operations:
* int Insert(object entity)
* T Select<T>(int id)
* T Select<T>(Guid id)
* T Select<T>(object[] ids)
* IList<T> Select<T>(Where where)
* int Update(object entity)
* int Update<T>(Set set, Where where)
* int Delete(object entity)
* int Delete<T>(Where where)
* U DoAggregate<T,U>(Aggregate aggregate, Where where)

##### v.0.2.0
Add support to transactions.

##### v.0.3.0
Multi Mapping and Foreing Keys (Select only)