config.yaml:
App1:
settings:
redirectUrl: http://www.test.com
App2:
settings:
redirectUrl:
test: http://www.test.com
prod: http://www.prod.com
C# objects
public class Config
{
public Dictionary<string, App> Apps { get; set; }
}
public class App
{
public Dictionary<string, Setting> Settings { get; set; }
}
public class Setting
{
public string Test {get;set;}
public string Prod {get;set;}
}
Expected result:
for App1
, both test
and prod
are the same http://www.test.com
for App2
, test
is http://www.test.com
and prod
is http://www.prod.com
I have done a lot of research but cannot figure out how to achieve this by using custom deserializer. Please help..