using System;
using System.Collections.Generic;
public class Program
{
public class X {
public string a { get; set; } = null;
}
public static void Main()
var list = new List<X>() {
new X() { a = "Toast" },
new X(),
null
};
foreach (var x in list) {
Console.WriteLine("result: " + (x?.a ?? "test"));