public class UserInputFile
{
public Action[] actions { get; set; }
}
public class Action
{
public Action1[] action1 { get; set; }
}
public class Action1
{
public string[] test { get; set; }
public string[] status { get; set; }
}
creating data like below
UserInputFile inputObject = new UserInputFile()
Action1 action1 = new Action1();
action1.test = new[] { "AccptenceTest" };
action1.status = new[] { "new" };
Action action = new Action();
action.action1 = new[] { action1 };
Action[] actionarray = new Action[1] { action };
inputObject = actionarray;
Converting Object to YAML using YAMLDOTNET
string YamlOutPut = yamlserlizer.Serialize(inputObject);
int id = callMethod(YamlOutPut)
since YamlOutPut doesn't have Dash ( -) before status , i am getting error in callmethod. could you please help me how to add dash (-) in front of status ?
YamlOutPut from above code ( Dash is missing infront of status) :
actions:
- action1:
- test:
- AccptenceTest
status:
- new
Need below output so that my callmethod works fine . status is missing - infornt of it which is causing the issue . how to add dash to status in Yaml ?
Expected Output :
actions:
- action1:
- test:
- AccptenceTest
- status:
- new