Open.Database.Extensions.Core
11.0.0-rc.8
dotnet add package Open.Database.Extensions.Core --version 11.0.0-rc.8
NuGet\Install-Package Open.Database.Extensions.Core -Version 11.0.0-rc.8
<PackageReference Include="Open.Database.Extensions.Core" Version="11.0.0-rc.8" />
<PackageVersion Include="Open.Database.Extensions.Core" Version="11.0.0-rc.8" />
<PackageReference Include="Open.Database.Extensions.Core" />
paket add Open.Database.Extensions.Core --version 11.0.0-rc.8
#r "nuget: Open.Database.Extensions.Core, 11.0.0-rc.8"
#:package Open.Database.Extensions.Core@11.0.0-rc.8
#addin nuget:?package=Open.Database.Extensions.Core&version=11.0.0-rc.8&prerelease
#tool nuget:?package=Open.Database.Extensions.Core&version=11.0.0-rc.8&prerelease
Open.Database.Extensions.Core
Core is the foundation of Open.Database.Extensions: ADO.NET extension methods with best-practice defaults, expressive commands that open, run and dispose their own connection, and Map<T>() to turn rows into objects. It has no database dependency of its own. Use it for any ADO.NET database; most applications need only this package.
dotnet add package Open.Database.Extensions.Core --prerelease
dotnet add package Microsoft.Data.Sqlite # your provider; SQLite is used below
using Microsoft.Data.Sqlite;
using Open.Database.Extensions;
public record Post(int Id, string Title);
// connectionString is yours, for example "Data Source=blog.db"; the query assumes a posts table (id, author, title, ...).
// Create the factory once per application. Use your provider's connection type.
var connectionFactory = new DbConnectionFactory<SqliteConnection>(() => new SqliteConnection(connectionString));
int author = 42;
// The command opens a connection when the terminal runs and disposes it afterwards.
Post[] posts = await connectionFactory
.Command("select * from posts where author = @author order by id")
.AddParam(author) // name and type inferred from the variable
.Map<Post>()
.ToArrayAsync();
AddParam(author) names the parameter author after the variable; AddParam("author", 42) names it yourself. Already have a connection? Start from it instead: connection.Command("..."). You own the connection; the command opens it only if it is closed and closes only what it opened.
Where to go next
- Getting started
- Expressive commands: parameters, stored procedures, timeouts, terminals
- Mapping rows to objects: the matching rules,
RowMap<T>, NULL handling - Coming from Dapper: the same jobs side by side
- Performance
Trimming and native AOT
Open.Database.Extensions is not marked trimmable, and native AOT is not supported in 11.0. Map<T>() and AddParams(...) read your types and the provider's data reader type by reflection, and build row readers as expression trees.
If you publish with PublishTrimmed=true, keep what ODX reads: the public constructors, properties and fields of every type you pass to Map<T>() and of every object you pass to AddParams, and the public methods of the provider's data reader type. A model type that is not kept fails at the first query with 'Post' cannot be mapped: it has no public constructor. A reader type that is not kept fails with Value cannot be null. (Parameter 'method').
This keeps all three. Call TrimRoots.Keep() once at startup. Post and Args stand for your own model type and your own AddParams object type:
using System.Diagnostics.CodeAnalysis;
using Microsoft.Data.Sqlite;
using static System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes;
static class TrimRoots
{
[DynamicDependency(
PublicConstructors | PublicProperties | PublicFields,
typeof(Post))]
[DynamicDependency(
PublicConstructors | PublicProperties | PublicFields,
typeof(Args))]
[DynamicDependency(PublicMethods, typeof(SqliteDataReader))]
public static void Keep() { }
}
It was measured with a trimmed, self-contained publish on .NET 10 (win-x64) and Microsoft.Data.Sqlite 10.0.14, whose reader type is SqliteDataReader. Other providers and .NET 11 were not run.
With these roots the trimmer reports a few IL2111 warnings (three more than without them in the measured publish); they are expected and the publish works.
The packages
| Package | What it adds | Targets |
|---|---|---|
| Open.Database.Extensions.Core (this package) | The foundation, expressive commands and Map<T>(). Provider-agnostic: start here. |
netstandard2.0, netstandard2.1, net10.0, net11.0 |
| Open.Database.Extensions.MSSqlClient | SqlConnectionFactory and stored procedures on Microsoft.Data.SqlClient. |
net472, net10.0, net11.0 |
| Open.Database.Extensions.SqlClient | The same API on the older System.Data.SqlClient. Deprecated: use MSSqlClient. |
netstandard2.0, netstandard2.1, net10.0, net11.0 |
| Open.Database.Extensions.Channel | Rows into System.Threading.Channels. |
netstandard2.0, netstandard2.1, net10.0, net11.0 |
| Open.Database.Extensions.Dataflow | Rows into TPL Dataflow blocks. | netstandard2.0, netstandard2.1, net10.0, net11.0 |
Every other package depends on Core, so installing one brings Core with it.
Documentation · API reference · Source and issues · MIT license
| 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 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. 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. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.14)
- System.Collections.Immutable (>= 10.0.14)
- System.Linq.AsyncEnumerable (>= 10.0.14)
- System.Memory (>= 4.6.3)
- System.Threading.Channels (>= 10.0.14)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.1
- System.Collections.Immutable (>= 10.0.14)
- System.Linq.AsyncEnumerable (>= 10.0.14)
- System.Threading.Channels (>= 10.0.14)
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Open.Database.Extensions.Core:
| Package | Downloads |
|---|---|
|
Open.Database.Extensions
Useful set of utilities and abstractions for simplifying modern data-access operations and ensuring DI compatibility. This is simply a meta-package that includes Open.Database.Extensions.Core. |
|
|
Open.Database.Extensions.Channel
Database extensions for pipelining data through channels. Includes Open.Database.Extensions.Core. |
|
|
Open.Database.Extensions.SqlClient
Useful set of utilities and abstractions for simplifying modern SQL Client data-access operations and ensuring DI compatibility. |
|
|
Open.Database.Extensions.Dataflow
Useful set of utilities and abstractions for simplifying modern data-access operations with Dataflow and ensuring DI compatibility. |
|
|
Open.Database.Extensions.MSSqlClient
Useful set of utilities and abstractions for simplifying modern SQL Client data-access operations and ensuring DI compatibility. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-rc.8 | 0 | 11/18/2026 |
| 11.0.0-rc.7 | 67 | 11/16/2026 |
| 11.0.0-rc.6 | 54 | 11/16/2026 |
| 11.0.0-rc.5 | 1,193 | 11/12/2026 |
| 11.0.0-rc.4 | 1,346 | 11/11/2026 |
| 11.0.0-rc.3 | 85 | 11/9/2026 |
| 11.0.0-rc.2 | 60 | 11/9/2026 |
| 11.0.0-rc.1 | 63 | 11/8/2026 |
| 11.0.0-preview06 | 90 | 11/8/2026 |
| 11.0.0-preview05 | 100 | 11/8/2026 |
| 11.0.0-preview04 | 102 | 11/6/2026 |
| 11.0.0-preview03 | 90 | 11/6/2026 |
| 11.0.0-preview02 | 100 | 11/6/2026 |
| 11.0.0-preview01 | 107 | 11/5/2026 |
| 10.3.0 | 684 | 11/5/2026 |
| 10.2.0 | 8,993 | 8/14/2026 |
| 10.1.0 | 590 | 8/13/2026 |
| 10.0.1 | 184 | 8/12/2026 |
| 10.0.0 | 245 | 8/12/2026 |
| 9.0.3-debug | 348 | 3/18/2025 |