using System.Collections.Generic;
public static class extensions{
public static IEnumerable<T> NotNull<T>(this IEnumerable<T> enumerable)
return enumerable.Where(e => e != null);
public string Prop1 {get;set;}
public static void Main()
List<Test?> objs = new List<Test?>
List<Test> filtered = objs.NotNull<Test?>().ToList();
Console.WriteLine(filtered.Count);