NStalling.Avro.DependencyInjection
0.2.0
dotnet add package NStalling.Avro.DependencyInjection --version 0.2.0
NuGet\Install-Package NStalling.Avro.DependencyInjection -Version 0.2.0
<PackageReference Include="NStalling.Avro.DependencyInjection" Version="0.2.0" />
<PackageVersion Include="NStalling.Avro.DependencyInjection" Version="0.2.0" />
<PackageReference Include="NStalling.Avro.DependencyInjection" />
paket add NStalling.Avro.DependencyInjection --version 0.2.0
#r "nuget: NStalling.Avro.DependencyInjection, 0.2.0"
#:package NStalling.Avro.DependencyInjection@0.2.0
#addin nuget:?package=NStalling.Avro.DependencyInjection&version=0.2.0
#tool nuget:?package=NStalling.Avro.DependencyInjection&version=0.2.0
NStalling.Avro.DependencyInjection
Microsoft.Extensions.DependencyInjection integration for
NStalling.Avro.
Provides IServiceCollection.AddAvro(...) for configuring runtime CLR type resolution and registering
the resulting Avro services.
Install
dotnet add package NStalling.Avro.DependencyInjection
NStalling.Avro is included as a dependency.
Usage
Register the concrete CLR types that correspond to known Avro record schemas:
using Microsoft.Extensions.DependencyInjection;
using NStalling.Avro.DependencyInjection;
services.AddAvro(options =>
options.Types(types => types
.Add<CustomerCreated>()
.Add<OrderPlaced>()));
Then resolve and use the configured serializer:
var serializer = serviceProvider.GetRequiredService<AvroSerializer>();
var envelope = serializer.Deserialize<Envelope>(bytes, schema);
AddAvro registers the following services as singletons:
AvroConfigurationIAvroTypeResolverAvroSerializer
Configuration is compiled during registration, so invalid mappings fail when the service collection is configured rather than on first use.
Configuration
AddAvro uses the same AvroOptions configuration API as the core package, including explicit mappings,
assembly registration, schema versions, and polymorphic payload configuration.
For the type-resolution model and full configuration options, see NStalling.Avro.
Sample
See the DependencyInjection sample for a complete runnable example.
License
Apache License 2.0. See 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 was computed. 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.Extensions.DependencyInjection.Abstractions (>= 3.1.32)
- NStalling.Avro (>= 0.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.