Код: Выделить всё
class Bar
{
public string Name { get; set; }
}
class Foo
{
public Bar Bar { get; set; }
}
class Program
{
static void Main(string[] args)
{
var foo = new Foo
{
Bar = { Name = "Hello" }
};
}
}
Подробнее здесь: https://stackoverflow.com/questions/384 ... 0-compiler