mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +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 monstersVO = await context.MonstersVO.ToListAsync(); | ||||||
|                 var spells = await context.Spells.ToListAsync(); |                 var spells = await context.Spells.ToListAsync(); | ||||||
| 
 | 
 | ||||||
|                 var serializer = new SerializerBuilder().WithTagMapping("!MonsterHD", typeof(MonsterHD)).EnsureRoundtrip().WithNamingConvention(new PascalCaseNamingConvention()).Build(); |                 var serializer = new SerializerBuilder() | ||||||
|                 var deserializer = new DeserializerBuilder().WithTagMapping("!MonsterHD", typeof(MonsterHD)).WithNamingConvention(new PascalCaseNamingConvention()).Build(); |                     .WithTagMapping("!MonsterHD", typeof(MonsterHD)) | ||||||
|                 var yaml = serializer.Serialize(monsters.FirstOrDefault()); |                     .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 sr = new StringReader(yaml); | ||||||
|                 var deser = deserializer.Deserialize(sr); |                 var deser = deserializer.Deserialize(sr); | ||||||
|                 Console.WriteLine(yaml); |                 Console.WriteLine(yaml); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez