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
                    
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="NStalling.Avro.DependencyInjection" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NStalling.Avro.DependencyInjection" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NStalling.Avro.DependencyInjection" />
                    
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 NStalling.Avro.DependencyInjection --version 0.2.0
                    
#r "nuget: NStalling.Avro.DependencyInjection, 0.2.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 NStalling.Avro.DependencyInjection@0.2.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=NStalling.Avro.DependencyInjection&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NStalling.Avro.DependencyInjection&version=0.2.0
                    
Install as a Cake Tool

NStalling.Avro.DependencyInjection

NuGet Version

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:

  • AvroConfiguration
  • IAvroTypeResolver
  • AvroSerializer

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 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. 
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
0.2.0 104 8/18/2026
0.1.1 104 8/16/2026
0.1.0 98 8/16/2026