Artisan.ORM
4.0.0
dotnet add package Artisan.ORM --version 4.0.0
NuGet\Install-Package Artisan.ORM -Version 4.0.0
<PackageReference Include="Artisan.ORM" Version="4.0.0" />
<PackageVersion Include="Artisan.ORM" Version="4.0.0" />
<PackageReference Include="Artisan.ORM" />
paket add Artisan.ORM --version 4.0.0
#r "nuget: Artisan.ORM, 4.0.0"
#:package Artisan.ORM@4.0.0
#addin nuget:?package=Artisan.ORM&version=4.0.0
#tool nuget:?package=Artisan.ORM&version=4.0.0
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 viaSqlBulkCopy, fed byMapperFormappers.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:
- What's New in v4
- The Sample
- Getting Started
- Read Methods Understanding
- Mappers
- cmd.AddTableParam
- BulkCopy
- MergeJoin
- Streaming with IAsyncEnumerable
- Code Generation
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:
- the
SqlDataReaderas the fastest method of data reading; - a bunch of its own extensions to ADO.NET SqlCommand and SqlDataReader methods, both synchronous and asynchronous;
- strictly structured static Mappers;
- user-defined table types as a mean of object saving;
- unique negative identities as a flag of new entities;
- a special approach to writing stored procedures for object reading and saving.
Artisan.ORM is available as NuGet Package.
More examples of the Artisan.ORM usage are available in the Tests and Database projects.
| Product | Versions 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. |
-
.NETStandard 2.1
- Microsoft.Data.SqlClient (>= 7.0.1)
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.1)
-
net8.0
- Microsoft.Data.SqlClient (>= 7.0.1)
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 |
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