Created
September 10, 2020 20:33
-
-
Save ankitvijay/b9b11c2a4ce27405ffae21cedfa8b09b to your computer and use it in GitHub Desktop.
C# dynamic issue
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 Program | |
{ | |
public static void Main() | |
{ | |
dynamic data = new { SomeProperty = "ABC" }; | |
var response = IsTrue(data); | |
if (response == "1") | |
{ | |
Console.WriteLine("How can this compile?"); | |
} | |
} | |
private static bool IsTrue(object someData) | |
{ | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment