AvroHelper.Generators 1.0.0

Additional Details

Upgrade to 1.0.1 or higher

There is a newer version of this package available.
See the version list below for details.
dotnet add package AvroHelper.Generators --version 1.0.0                
NuGet\Install-Package AvroHelper.Generators -Version 1.0.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="AvroHelper.Generators" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AvroHelper.Generators --version 1.0.0                
#r "nuget: AvroHelper.Generators, 1.0.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.
// Install AvroHelper.Generators as a Cake Addin
#addin nuget:?package=AvroHelper.Generators&version=1.0.0

// Install AvroHelper.Generators as a Cake Tool
#tool nuget:?package=AvroHelper.Generators&version=1.0.0                

AvroHelper

Source generator to make implementing ISpecificRecord less of a pain.

Usage

Install NuGet package

dotnet add package AvroHelper.Generators

Apply attribute to your partial class

Any property with an AvroColumnAttribute will be included in mapping.

using AvroHelper

[GeneratedAvroRecord]
public partial class MyRowDto
{
  public string SomeId { get; set; }
  
  [AvroColumn(0, ColumnName = "some_RiDiCuLoUs_name")]
  public string SensibleName { get; set; }

  [AvroColumn(0, ColumnName = "DATE_COLUMN", UnderlyingType = "int", LogicalType = "date")]
  public DateTime? DateColumn { get; set; }
}

The souce generator will implement ISpecificRecord with implementations of the Schema, Get, and Put. It will only add the Schema if your class does not already have a Schema Get method, so if you don't want to use the generator's schema, just implement that yourself.

var datumReader = new SpecificDatumReader<MyRowDto>(schema, schema);
using var stream = avroRows.SerializedBinaryRows.Memory.AsStream();
var decoder = new BinaryDecoder(stream);

while (stream.Position < stream.Length)
{
    var @record = datumReader.Read(null!, decoder);
    yield return @record;
}
There are no supported framework assets in this 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
1.0.1 1,031 11/21/2022
1.0.0 258 11/21/2022 1.0.0 is deprecated because it has critical bugs.