Last active
January 16, 2020 14:57
-
-
Save dlemstra/407015580ec2010f32660118be960e9c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using System; | |
namespace WeirdDynamic | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var foo = CreateFoo(); | |
var bar = CreateBar(foo.Id); | |
Console.WriteLine(bar.Id); | |
} | |
static Bar CreateBar(int id) => new Bar(id); | |
static dynamic CreateFoo() => new { Id = 42 }; | |
class Bar | |
{ | |
public Bar(int id) { } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment