The Serialization Utils help with serializeing to and from Base64, Binary, Xml, ...
$ dotnet add package Mastronardi.Utils.SerializationTo convert a .Net image to a base64 string you can use this:
Base64.ImageToBase64(Image image, ImageFormat format, int quality = 90)
This is useful for embedding images in your Html.
To convert back to an image:
Base64.Base64ToImage(string base64String)
To convert a string back and forth:
Base64.Base64Encode(string input)
and
Base64Decode(string base64string)
This will convert your object to a MemoryStream
Binary.Serialise(Object o)
This will read your stream and make it again into an object:
Binary.DeSerialize(Stream s)
When you want flags to be serialized as a comma separated list of flags use this `FlagConverter
FlagConverter<F>
Where F is your Enum.