paiden/Nett

Nett.Coma throws NotImplementedException if table array is using

kzmi opened this issue · 0 comments

kzmi commented

TOML:

[info]

[[info.product]]
name = "product1"
number = 10000

[[info.product]]
name = "product2"
number = 10001

Classes:

public class Product
{
    public string name { get; set; }
    public int number { get; set; }
}

public class Info
{
    public Product[] product { get; set; }
}

public class ProductInfo
{
    public Info info { get; set; }
}

Conversion to TomlTable succeeds.

TomlTable table = Toml.ReadFile("productinfo.toml");

But the following code using Nett.Coma throws NotImplementedException.

ProductInfo loaded =
    Nett.Coma.Config.CreateAs()
    .MappedToType(() => new ProductInfo())
    .StoredAs(store => store.File("productinfo.toml"))
    .Initialize()
    .Get(_ => _);