Guest User

Untitled

a guest
Apr 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. void MyMethod(Delegate d){};
  2. void MyMethod(Expression exp){};
  3. void MyMethod(object obj){};
  4.  
  5. MyMethod((int a) => a)
  6.  
  7. "Cannot convert lambda expression to type 'object' because it is not a delegate type"
  8.  
  9. void MyMethod(Func<int, int> d){};
  10.  
  11. void MyMethod(Func<int, int> objFunc)
  12.  
  13. void MyMethod(Action<int> func) { }
  14.  
  15. void MyMethod(Action<int> lambdaHereLol)
  16. {
  17. lambdaHereLol(2);
  18. }
  19.  
  20. var hurrDurr = 5;
  21. MyMethod(x => Console.Write(x * hurrDurr));
  22.  
  23. MyMethod((Delegate)(Func<int, int>)((int a) => a));
  24.  
  25. void MyMethod(Delegate d);
Add Comment
Please, Sign In to add comment