You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The YAML I need to produce has a parameter that includes a hypen such as log-level: debug. How do I achieve this with C# class? Is that using JSON name attribute?
Also how can I inject comments for example # log-level configures the log level
The text was updated successfully, but these errors were encountered:
Yes, you can use the [YamlMember] attribute to do both of these.
usingYamlDotNet.Serialization;varserializer=newYamlDotNet.Serialization.SerializerBuilder().Build();Console.WriteLine(serializer.Serialize(newTest(){LogLevel="info"}));classTest{[YamlMember(Alias="log-level",Description="log-level configures the log level")]publicstringLogLevel{get;set;}}
Results in this:
# log-level configures the log levellog-level: info
The YAML I need to produce has a parameter that includes a hypen such as log-level: debug. How do I achieve this with C# class? Is that using JSON name attribute?
Also how can I inject comments for example # log-level configures the log level
The text was updated successfully, but these errors were encountered: