using System.Collections.Generic;
public class SomeDataClass
public IList<int> ListA { get; set; }
public IList<int> ListB { get; set; }
public string GetAsString()
"A: " + (ListA == null ? "null\n" : string.Join(", ", ListA)) + '\n' +
"B: " + (ListB == null ? "null\n" : string.Join(", ", ListB)) + '\n';
private static void AppendValue(IList<int> li)
public static void Main()
var o = new SomeDataClass();
o.ListA = new List<int>();
Console.WriteLine(o.GetAsString());