I admit that this question is subjective but I am interested in the view of the community. I have a cache class that takes a cache loader function of type Func
There are precedents for using a noun in the Framework, e.g.
Enumerable.Average(this IEnumerable source, Func selector)
Enumerable.Count(this IEnumerable source, Func predicate)
Enumerable.GroupBy(this IEnumerable source, Func keySelector, Func elementSelector)
ConcurrentDictionary.GetOrAdd(TKey key,
Func valueFactory);
The noun is often an appropriate verb with an agentive suffix.
In your example I would use something like loader
or possibly valueFactory
. I personally don't like cacheLoader
because presumably it's the caller rather than the delegate that does the work of inserting in the cache.