Specifically, I want to write this:
public Func, T> SelectElement = list => list.First();
But I get a syntax error
public static void SomeContainerFunction() { const string NULL_VALUE = (string)null; Type GetValueType(T value) => value?.GetType() ?? typeof(T); var typeOfNullValue = GetValueType(NULL_VALUE); Debug.WriteLine($"Value: {NULL_VALUE}, Type: {typeOfNullValue}"); }