Hi im using a class having 3 properties where one of the property is an array. I want to add list of data to the class.
public class model
{
public string Name { get; set; }
public string Status { get; set; }
public string[] Actions { get; set; }
}
while Adding value to the above class if the status property has value 'success' I've to add the values 'pause and refresh' for 'Actions'. otherwise I've to add the values 'start and refresh'. when I try like below im getting compile error
model m = new model
{
Name = "aaa",
Status = "success",
Actions=new string[]{
if(status=="success){
"Stop",
"Restart"
}
}
};
is it possible to add value based on the condition like above?