Why would this compile:
public Dictionary<ValueLineType, Func<HtmlHelper, string, object, Type, string>> constructor = new Dictionary<ValueLineType, Func<HtmlHelper, string, object, Type, string>>();
but not this other one with one extra parameter in the Func (the boolean):
public Dictionary<ValueLineType, Func<HtmlHelper, string, object, Type, bool, string>> constructor = new Dictionary<ValueLineType, Func<HtmlHelper, string, object, Type, bool, string>>();
Either I’m getting blind or there’s something else I’m going to learn today 😀
There is no such thing as
Func<T1,T2,T3,T4,T5,TResult>. It only goes as far as 4 parameters (i.e. 5 type parameters, including one for the return value):You can declare your own, of course:
However, at that point I’d think really carefully about whether you might be able to encapsulate some of those parameters together. Are they completely unrelated?