Created
August 23, 2017 09:09
-
-
Save jonwarghed/9eaee08053d821ca29a99d29c462f549 to your computer and use it in GitHub Desktop.
What is this C# syntax called?
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
namespace Trine.CLI | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
new Crash | |
{ | |
Inner = {Name = "what"} | |
}; | |
} | |
} | |
public class InnerType { | |
public string Name { get; set; } | |
} | |
public class Crash | |
{ | |
public InnerType Inner { get; set; } | |
} | |
} |
namespace Trine.CLI
{
class Program
{
static void Main(string[] args)
{
new Crash
{
InnerNew_Property = { Name = "what" }
};
}
}
public class InnerType
{
public string Name { get; set; }
}
public class Crash
{
private InnerType InnerNew_Field = new InnerType();
public InnerType InnerNew_Property
{
get
{
return InnerNew_Field;
}
set
{
InnerNew_Field = value;
}
}
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wierd? its called "object initializer"