public class ClassA > { > protected virtual string InvokeString { get; set; } > } > > public class ClassB : ClassA > { > public void SetInvokeString(string s) > { > base.InvokeString = s; > } > > public new string InvokeString > { > get { return base.InvokeString; } > } > }This doesn't seem to work for me. I implemented it this same way and added the methods SetInvokeString and new String InvokeString in both classes. However, after I set the property in one class, the same property in another class is still null.
protected virtual String InvokeString { get; set; }I have two separate classes that inherit from this one. In both I added the exact same code as you showed.
public String Invoke(String input) { Dictionary<String, String> parameters = new Dictionary<String, String>(StringComparer.OrdinalIgnoreCase); this.SetInvokeString(input);And in the other class I added also both methods and I have this code:
Logging.Log(String.Format("Calling Remote VoidPaymentPlanPass On {0} with: ", ip, this.InvokeString));When I debug my test I see that this.InvokeString is null.