using System; public class Base { public virtual string Foo { get; } public Base() { Console.WriteLine("Base()"); Foo = "value from Base()"; Console.WriteLine($"Foo = {Foo}"); } } public class Derived : Base { public override string Foo { get; } = "value from Derived init"; } public class Test { public static void Main() { Base x = new Derived(); Console.WriteLine($"main: {x.Foo}"); } }