Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Created September 10, 2020 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/b9b11c2a4ce27405ffae21cedfa8b09b to your computer and use it in GitHub Desktop.
Save ankitvijay/b9b11c2a4ce27405ffae21cedfa8b09b to your computer and use it in GitHub Desktop.
C# dynamic issue
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