using System.Collections.Generic;
public static class EnumerableExtensions
public static IEnumerable<T> OrEmptyIfNull<T>(this IEnumerable<T> source)
return source ?? Enumerable.Empty<T>();
public List<int> TestChild {get; set;}
public static void Main()
var testList = new TestList();
var x = testList?.TestChild.OrEmptyIfNull();
Console.Write(x == null);