using System;
public class Program
{
public static void Main()
Parent p = new Parent()
Name = "Parent",
Child = new Child()
};
Console.WriteLine(p.Child.Parent.Name);
}
public class Parent
public string Name {get; set;}
public Child Child {
get { return this._child; }
set {
this._child = value;
if(value != null)
value.Parent = this;
private Child _child;
public class Child
public Parent Parent {get; set;}