You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an enum, and a class that contains an enum property:
namespace TomlynTests
{
public enum SizeType : byte
{
Average,
Big,
Small
}
}
namespace TomlynTests
{
public class TestModel
{
public string Name { get; set; }
public SizeType Size { get; set; }
public TestModel(string name, SizeType size)
{
Name = name;
Size = size;
}
}
}
When I create toml text from this the enum property value isn't serialized:
using Tomlyn.Model;
using Tomlyn;
using TomlynTests;
TestModel model = new("Pliers", SizeType.Small);
TomlTable table = new()
{
{ "model", model }
};
string text = Toml.FromModel(table);
Console.WriteLine(text);
[model]
name = "Pliers"
[model.size]
Is there something special I need to do to serialize enums?
The text was updated successfully, but these errors were encountered:
taks
added a commit
to taks/Tomlyn
that referenced
this issue
Jun 30, 2023
I have an enum, and a class that contains an enum property:
When I create toml text from this the enum property value isn't serialized:
Is there something special I need to do to serialize enums?
The text was updated successfully, but these errors were encountered: