C# - Part 99 - Action vs Func vs Predicate (with example) - Tutorial For Beginners
HTML-код
- Опубликовано: 8 фев 2025
- The main differences between Func, Action, and Predicate in C# are the number of input parameters, the return type, and the type of value returned:
Func: Can have 0 to 16 input parameters of different types, but it must have one return type.
Action: Can have 1 to 16 input parameters, but it does not return any value.
Predicate: Has one input parameter and always returns a Boolean value, either True or False.