By convention classes are often named like nouns, methods like verbs and interfaces like adjectives.
What is the common naming convention for a delegate? Or what's a good way to differentiate its name when delegates are listed among types and other things?
My immediate assumption is to name a delegate more likely an adjective because a single method interface can often be replaced with a delegate.
Some thoughts:
delegate object ValueExtracting(object container);
delegate object ValueExtractor(object container);
delegate object ValueExtractionHandling(object container);
delegate object ValueExtractionHandler(object container);
Based on
Enumerable.Sum
, I'd pass the delegate as aFunc<object, object>
and name the parameterselector
:If you have to make your own delegate for it, I'd go with
ValueExtractor
since that's the most descriptive name for what it does.