Skip to content

Instantly share code, notes, and snippets.

@OdeToCode
Created April 5, 2015 14:51
Show Gist options
  • Select an option

  • Save OdeToCode/ca8a44f166394879259d to your computer and use it in GitHub Desktop.

Select an option

Save OdeToCode/ca8a44f166394879259d to your computer and use it in GitHub Desktop.
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