Artisan.ORM 4.0.0

dotnet add package Artisan.ORM --version 4.0.0
                    
NuGet\Install-Package Artisan.ORM -Version 4.0.0
                    
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="Artisan.ORM" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Artisan.ORM" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Artisan.ORM" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Artisan.ORM --version 4.0.0
                    
#r "nuget: Artisan.ORM, 4.0.0"
                    
#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.
#:package Artisan.ORM@4.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Artisan.ORM&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Artisan.ORM&version=4.0.0
                    
Install as a Cake Tool

Artisan.Orm Logo Artisan.ORM

ADO.NET Micro-ORM to SQL Server. Multi-targets .NET Standard 2.1, .NET 8 and .NET 10 (since 4.0.0). Use version 3.5.x for .NET Standard 2.1-only projects, or version 2.x.x (built against .NET Standard 2.0) for .NET Framework and earlier .NET Core.

ADO.NET Micro-ORM to SQL Server.

First there was a desire to save a graph of objects for one access to the database:

  • one command on the client,
  • one request to the application server,
  • one access to the database.

Thus the method of How to Save an Object Graph in Master-Detail Relationship with One Stored Procedure was found.

Then there was a desire of more control over Object-Relational Mapping, better performance and ADO.NET code reduction.

Thus a set of extensions to ADO.NET methods turned into a separate project. Here is a story about Artisan.Orm or How To Reinvent the Wheel.

Finally the object graph saving method required a new approach to transmitting more details about exceptional cases. The Artisan Way of Data Reply became such an answer.

For hierarchical data — folder trees, organisation charts and the like — the Id-ParentId model can be combined with SQL Server's hierarchyid for the best of both worlds. See Combination of Id-ParentId and HierarchyId Approaches to Hierarchical Data.

Note: the four articles above were originally published on CodeProject between 2016 and 2021. CodeProject went read-only in late 2024; the articles have been re-published in articles/ under CC-BY-SA-4.0.

What's new in 4.0

  • Multi-target: netstandard2.1, net8.0, net10.0.
  • BulkCopy / BulkCopyAs — high-throughput inserts via SqlBulkCopy, fed by MapperFor mappers.
  • ReadToLists<T1..T6> — multiple result sets to N strongly-typed lists in one call.
  • ReadToAsyncEnumerable<T> / ReadAsAsyncEnumerable<T>IAsyncEnumerable<T> streaming.
  • MergeJoin — in-memory master/detail/sub-detail joining without ORM-level SQL joins.
  • RunInTransaction / RunInTransactionAsync — autocommit-on-return transaction wrappers.
  • Nullable Reference Types across the whole public API.
  • SourceLink + symbols (.snupkg) — step-into debugging from any IDE.

See CHANGELOG.md for the full list.

What to read for better understanding

Full information about Artisan.ORM is available in documentation Wiki.

The most interesting articles from Wiki are:

Some propositions, statements and additional information

Artisan.ORM was created to meet the following requirements:

  • interactions with database should mostly be made through stored procedures;
  • all calls to database should be encapsulated into repository methods;
  • a repository method should be able to read or save a complex object graph with one stored procedure;
  • it should work with the highest possible performance, even at the expense of the convenience and development time.

To achieve these goals Artisan.ORM uses:

Artisan.ORM is available as NuGet Package.

More examples of the Artisan.ORM usage are available in the Tests and Database projects.

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 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
4.0.0 159 5/8/2026
3.5.1 1,031 5/26/2025
3.5.0 650 1/17/2025
3.1.1 952 1/18/2024
3.1.0 509 12/22/2023
3.0.0 1,036 4/20/2023
2.5.0 232 6/6/2025
2.2.0 1,427 1/23/2021
2.1.0 1,219 12/24/2019
2.0.0 2,204 2/4/2018
1.5.1 194 6/6/2025
1.1.3 2,462 2/4/2018
1.1.1 3,490 6/21/2017
1.1.0 3,657 4/16/2017
1.0.8 2,508 1/31/2017
1.0.7 2,581 12/30/2016
1.0.6 2,549 12/11/2016
Loading failed

Artisan.ORM 4.0.0 — first major version since 3.5.1.

Targeting:
- Multi-target: netstandard2.1, net8.0, net10.0.
- Microsoft.Data.SqlClient bumped to 7.0.1.

New APIs:
- BulkCopy / BulkCopyAs (sync + async) — high-throughput inserts via SqlBulkCopy with MapperFor mappers.
- ReadToLists / ReadToListsAsync — multiple result sets to N strongly-typed lists in one call (T1..T6).
- ReadToAsyncEnumerable / ReadAsAsyncEnumerable — IAsyncEnumerable<T> streaming for very large result sets.
- MergeJoin (rewritten) — in-memory join of master/detail/sub-detail result sets without ORM-level joins.
- RunInTransaction / RunInTransactionAsync — autocommit-on-return transaction wrappers.

Quality & API surface:
- Nullable Reference Types enabled across the entire library.
- Async transaction API: IAsyncDisposable, ConfigureAwait(false), CancellationToken throughout.
- Thread-safe NegativeIdentity generators (Int16/Int32/Int64).
- ArtisanMappingException replaces internal NullReferenceException / ApplicationException.
- AddParam extensions no longer use 'dynamic' (faster, AOT-friendlier).
- Schema-based mapper cache key — no more reflection on SqlDataReader.Command.
- MappingManager: safe reflection and lazy initialization.

Packaging:
- Deterministic builds, SourceLink, symbol (.snupkg) packages.
- XML documentation file shipped in the package.
- Re-published the four CodeProject design articles under /articles.

Full notes: https://github.com/lobodava/artisan-orm/blob/master/CHANGELOG.md