NativeData.Extensions.DependencyInjection
1.0.1
dotnet add package NativeData.Extensions.DependencyInjection --version 1.0.1
NuGet\Install-Package NativeData.Extensions.DependencyInjection -Version 1.0.1
<PackageReference Include="NativeData.Extensions.DependencyInjection" Version="1.0.1" />
<PackageVersion Include="NativeData.Extensions.DependencyInjection" Version="1.0.1" />
<PackageReference Include="NativeData.Extensions.DependencyInjection" />
paket add NativeData.Extensions.DependencyInjection --version 1.0.1
#r "nuget: NativeData.Extensions.DependencyInjection, 1.0.1"
#:package NativeData.Extensions.DependencyInjection@1.0.1
#addin nuget:?package=NativeData.Extensions.DependencyInjection&version=1.0.1
#tool nuget:?package=NativeData.Extensions.DependencyInjection&version=1.0.1
NativeData.Extensions.DependencyInjection
Microsoft.Extensions.DependencyInjection integration for NativeData.
Contents
AddNativeData<TContext>()— registers a scopedNativeDataContextsubclass, a singletonIDbConnectionFactory, and a singletonISqlDialectNativeDataOptions— configuration object passed to provider extension methods (UseSqlite,UsePostgres)
Usage
builder.Services.AddNativeData<AppContext>(o => o.UseSqlite("Data Source=app.db"));
// or
builder.Services.AddNativeData<AppContext>(o => o.UsePostgres(connectionString));
Provider extension methods (UseSqlite, UsePostgres) are shipped in their respective provider packages — NativeData.Sqlite and NativeData.Postgres.
Service lifetimes
| Service | Lifetime |
|---|---|
TContext |
Scoped |
IDbConnectionFactory |
Singleton |
ISqlDialect |
Singleton |
AOT / Trimming
AOT-safe. AddNativeData<TContext>() is annotated with [DynamicallyAccessedMembers(PublicConstructors)] — the only reflection touch point. Entity map registration uses the generated NativeDataEntityMaps.Create<T>() factory with no runtime type scanning.
Build
dotnet build src/NativeData.Extensions.DependencyInjection/NativeData.Extensions.DependencyInjection.csproj
Packaging
This project is packable and published as a NuGet package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- NativeData.Abstractions (>= 1.0.1)
- NativeData.Core (>= 1.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on NativeData.Extensions.DependencyInjection:
| Package | Downloads |
|---|---|
|
NativeData.Sqlite
NativeData is an AOT-first ORM foundation for .NET with provider-agnostic runtime contracts and source-generation-oriented architecture. |
|
|
NativeData.Postgres
NativeData is an AOT-first ORM foundation for .NET with provider-agnostic runtime contracts and source-generation-oriented architecture. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Use docs/release-notes-template.md as the baseline for release notes and changelog entries.