I'm thinking of creating something like this:
Class.Method<OtherClass>(x => new Dictionary<string, string> { { nameof(x.Property), "Hello World!" } });
I'd like the Method to be void, but somehow I can't get this done. I understand that this signature is
public static void Method<T>(Func<T, Dictionary<string, string>> func)
but I don't want to use the dictionary az a TResult. All I want is to have a dictionary as an input and fill the keys from the T type. Is this possible somehow?