| Start | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without parameters This example shows how to create a delegate that encapsulates the method that returns the current time |
||||||||||||||||||||
With multiple variables |
||||||||||||||||||||
| Lambda & anonymous methods An anonymous method can be assigned wherever a delegate is expected: Lambda expressions can be used to express the same thing: In either case, we can now invoke the method stored inside Or as a shorthand: Notice that for the assignment to be type-safe, the parameter types and return type of the anonymous method must match those of the delegate type: |
||||||||||||||||||||
| Covariant & Contravariant Type Parameters
Syntax
Parameters
|
Read Article
https://develop.horje.com/learn/1434/reference