Lombok.NET
Lombok.NET copied to clipboard
Generator To Serialize/Deserialize Objects
It would be really nice to have a generator to serialize/deserialize objects to binary.
Example:
[Serializeable]
public partial class MyClass {}
that generates two methods, one for serialisation with a binarywriter and one for deserialisation with binaryreader
That's a great idea. Unfortunately I'm a bit swamped at the moment and will only be able to get to this in a couple of weeks.
In the meantime, I'd be happy to accept a PR in case you're interested.
@furesoft I have started working on this, but am not quite sure what you are proposing. Using BinaryFormatter
is discouraged, so maybe you could share what the generated code should look like?
Using BinaryWriter and BinaryWriter and serialize/deserialize obeject froms scratch
Hey, I had the same idea, I think, so I would share this here: https://github.com/xafero/csharp-generators/blob/main/src/Cscg.Compactor/CompactGenerator.cs
Generating a read and write method for every property in the class with BinaryReader and BinaryWriter.
@xafero That looks great! Would you like me to add that to this library?
@xafero That looks great! Would you like me to add that to this library?
Sure. Maybe my code is rough, but I saw this issue and wanted to maybe help. Because I like Lombok and your take on it.
Available in v2.4.0