User Tools

Site Tools


notes:csharp:delegates

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notes:csharp:delegates [2017/06/01]
leszek [Func and Action]
notes:csharp:delegates [2017/06/01] (current)
leszek [Func and Action]
Line 248: Line 248:
 string result = fun(2, 3); // result == "​6"​ string result = fun(2, 3); // result == "​6"​
  
-Func<​int,​ int> square = x => x * x;+Func<​int,​ int> square = x => x * x; // the same as: x => { return x * x; };
 int result = square(3); // result == 9 int result = square(3); // result == 9
 </​code>​ </​code>​
notes/csharp/delegates.txt ยท Last modified: 2017/06/01 by leszek