public void EnableExtendingSealedClasses() { // Event though the host class is sealed, we can use the sum method as though it were a member var ssc = new SomeSealedClass { A = 6, B = 200 }; Assert.Equal(206, ssc.Sum()); }
public static int Sum(this SomeSealedClass ssc) { return(ssc.A + ssc.B); }