using System.Collections.Generic;
static string Foo() => "Шарп так может";
static string Foo2() => null;
static string Foo3() => "Котлин ко ко ко";
static string Foo4() => null;
static void Main(string[] args)
var list = new List<string>();
Foo().Let(s => list.Add(s));
Foo2().Let(s => list.Add(s));
Foo3().Let(s => list.Add(s));
Foo4().Let(s => list.Add(s));
Console.WriteLine(string.Join("\n", list));
public static void Let<T>(this T item, Action<T> callback)