mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
Test yaml
This commit is contained in:
parent
8e9d05822c
commit
c490ea8854
1 changed files with 14 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue