Func, Action, Predicate and Delegates
-
Func, Action, Predicate and Delegates
-
Delegate- é um ponteiro para uma função
- Abaixo estão os 3 tipos de delegates
Func- Pega um input e retorna uma saída genérica
Action- Pega um input genérico e retorna
nothing
- Pega um input genérico e retorna
Predicate- Pega um input genérico e sempre retorna o tipo
boolean
- Pega um input genérico e sempre retorna o tipo
- Following LINQ methods uses delegates:
.Selectmethod takesFunc.ForEachmethod takes anAction.FindAllmethod takes aPredicate
