Created
May 14, 2009 22:17
-
-
Save skoon/111961 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestClass : ConsoleApplication1.ITestClass | |
{ | |
//dynamic fooLambda = () => { return "foo"}; | |
//dynamic fooAnonDelegate = delegate() { return "foo" }; | |
//Those don't work "Cannot convert lambda to 'dynamic' because it | |
//is not a delegate type | |
public TakeSomeFoo TakeSome = () =>{ return "foo"; }; | |
public delegate string TakeSomeFoo(); | |
public string fooBar { get; set; } | |
public string foo() | |
{ | |
dynamic dynFoo = this.TakeSome; | |
this.TakeSome = () => { return "MegaFoo"; }; | |
return dynFoo(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment