Inheritance: UnsealedSemiImmutable
Exemple #1
0
    public static void Main()
    {
        var naughty = new DerivedMutable(1);
        var example = new ExampleOfUnsealedImmutable(naughty);

        naughty.OtherValue = 10;
    }
Exemple #2
0
    public static void Main()
    {
        var naughty = new DerivedMutable(1);

        UnsealedSemiImmutable isThisImmutable = naughty;

        Console.WriteLine(isThisImmutable); // 0
        naughty.OtherValue = 10;
        Console.WriteLine(isThisImmutable); // 10! State has changed.
    }
 public static void Main()
 {
     var naughty = new DerivedMutable(1);
     var example = new ExampleOfUnsealedImmutable(naughty);
     naughty.OtherValue = 10;
 }