This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Invoice class generated from a avro protocol file (.avpr) using the nuget package Apache.Avro.Tools | |
Invoice invoice = new Invoice(); | |
invoice.invoiceno = 123; | |
// ...(more invoice properties set here) | |
// set destination | |
string filePath = String.Format(@"C:\AvroInvoices\{0}.avro", invoice.invoiceNo); | |
// write avro schemaless file - logic adapted from https://stackoverflow.com/q/36793657/194872 | |
SpecificDatumWriter<Invoice> writer = new SpecificDatumWriter<Invoice>(Invoice._SCHEMA); |