Created
April 5, 2015 14:51
-
-
Save OdeToCode/ca8a44f166394879259d 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
| public class Employee | |
| { | |
| public Employee() | |
| { | |
| HomeAddress = new Address(); | |
| } | |
| public int Id { get; set; } | |
| public string Name { get; set; } | |
| public Address HomeAddress { get; set; } | |
| } | |
| public class Address | |
| { | |
| public string City { get; set; } | |
| public string Country { get; set; } | |
| } | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| var scott = new Employee | |
| { | |
| Id = 1, | |
| Name = "Scott", | |
| HomeAddress = { City = "Hagerstown", Country = "USA" } | |
| }; | |
| Console.WriteLine(scott); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment