public static void Main()
var bse = JsonConvert.DeserializeObject<MutablePropertyStore>("{ 'PropertyB' : true }");
Console.WriteLine("Base: " + bse.ToString());
var derived = new ImmutablePropertyStore(bse);
Console.WriteLine("Derived: " + derived.ToString());
public sealed class ImmutablePropertyStore : MutablePropertyStore
public new bool PropertyA { get; private set; }
public new bool PropertyB { get; private set; }
public ImmutablePropertyStore() { }
public ImmutablePropertyStore(MutablePropertyStore ms)
PropertyA = ms.PropertyA;
this.PropertyB = ms.PropertyB;
public ImmutablePropertyStore(bool propertyA = true, bool propertyB = false)
public override string ToString()
=> $"Property A is '{PropertyA}' and Property B is '{PropertyB}'.";
public class MutablePropertyStore
public virtual bool PropertyA { get; set;}
public virtual bool PropertyB { get; set;}
public MutablePropertyStore() { }
public override string ToString()
=> $"Property A is '{PropertyA}' and Property B is '{PropertyB}'.";