C#C
C#10mo ago
Faker

✅ Use of Func as part of function definition

C#
static Func<int, int> GetMultiplier(int factor)
{
    return (num) => num * factor;
}

Hello guys, I came across this function definition where we use Funct<> as part of the function definition. I'm a bit lost here, what are we doing? I know that Func<> is a delegate where we can store function references but here we aren't doing that. Oh, or may be that's because we are returning a function reference?
Was this page helpful?