1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 14:35:45 +00:00

Test yaml

This commit is contained in:
Yan Maniez 2019-01-16 23:35:35 +01:00
parent 8e9d05822c
commit c490ea8854

View file

@ -321,9 +321,20 @@ namespace AideDeJeuCmd
var monstersVO = await context.MonstersVO.ToListAsync();
var spells = await context.Spells.ToListAsync();
var serializer = new SerializerBuilder().WithTagMapping("!MonsterHD", typeof(MonsterHD)).EnsureRoundtrip().WithNamingConvention(new PascalCaseNamingConvention()).Build();
var deserializer = new DeserializerBuilder().WithTagMapping("!MonsterHD", typeof(MonsterHD)).WithNamingConvention(new PascalCaseNamingConvention()).Build();
var yaml = serializer.Serialize(monsters.FirstOrDefault());
var serializer = new SerializerBuilder()
.WithTagMapping("!MonsterHD", typeof(MonsterHD))
.WithTagMapping("!MonsterVO", typeof(MonsterVO))
.WithTagMapping("!Monsters", typeof(List<Monster>))
.EnsureRoundtrip()
.WithNamingConvention(new PascalCaseNamingConvention())
.Build();
var deserializer = new DeserializerBuilder()
.WithTagMapping("!MonsterHD", typeof(MonsterHD))
.WithTagMapping("!MonsterVO", typeof(MonsterVO))
.WithTagMapping("!Monsters", typeof(List<Monster>))
.WithNamingConvention(new PascalCaseNamingConvention())
.Build();
var yaml = serializer.Serialize(monsters);
var sr = new StringReader(yaml);
var deser = deserializer.Deserialize(sr);
Console.WriteLine(yaml);