Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Header #145

Closed
Cutlass76 opened this issue Jan 25, 2024 · 2 comments
Closed

Add a Header #145

Cutlass76 opened this issue Jan 25, 2024 · 2 comments
Labels
awaiting user An item is awaiting user input

Comments

@Cutlass76
Copy link

Cutlass76 commented Jan 25, 2024

Forgive me if this is silly question:
I need to add a header to the headerless file I successfully created using the nuget package.
I have a C# class (Event) that models the data.
ex:
namespace Cars.Models
{
public class CarsEvent
{
public Cars Cars{ get; set; }
}
public class Cars
{
public object Door{ get; set; }
public string Wheels{ get; set; } = "";
public object Hood{ get; set; }
}
}
I created the schema
schema = AvroConvert.GenerateSchema(Event.GetType());
I create the avro file
byte[] avroSerializedTo;
avroSerializedTo = AvroConvert.SerializeHeadless(Event, schema);
How do I add a header?

@AdrianStrugala
Copy link
Owner

Hey @Cutlass76,
Would simply:
avroSerializedTo = AvroConvert.Serialize(Event);
work for you?
Best,
Adrian

@AdrianStrugala AdrianStrugala added the awaiting user An item is awaiting user input label Feb 10, 2024
Copy link

Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting user An item is awaiting user input
Projects
None yet
Development

No branches or pull requests

2 participants