Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1.  
  2. using System;
  3.  
  4. namespace ConsoleApplication15
  5. {
  6. public class Args
  7. {}
  8.  
  9. public class Class
  10. {
  11. public void Execute(Args args)
  12. {
  13. Console.WriteLine(args);
  14. }
  15. }
  16.  
  17. class Program
  18. {
  19. static void Main()
  20. {
  21. dynamic c = new Class();
  22.  
  23. // doesn't work:
  24. // object args = new Args();
  25.  
  26. // works:
  27. //dynamic args = new Args();
  28.  
  29. // works
  30. var args = new Args();
  31.  
  32. c.Execute(args);
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement