This is a curiosity questions for you all in the know:
Is there any harm/downside to using a Func instead of a method? Simple example:
private static Func<int, int, DBContext, List<T>> Foo =
(i1, i2, dbc) =>
(i1 != 0) ? dbc.Bar(i2) : new List<T> { /*some default values ...*/ };
Vs
private static List<T> Foo(int i1, int i2, DBContext dbc)
{
return i1 != 0 ? dbc.Bar(i2) : new List<T> { /*some default values ...*/ };
}
I see severale downsides:
as you gain nothing I would only to so in a local and small context and prefer the static method