We have the interface and the implementing class:
pubic interface IStackContainer {
const string DefaultStack = "default";
}
public class StackContainer<T> : MyBaseStackContainer<T>, IStackContainer{
protected internal string Stack {
get { return Get(nameof(Stack), IInterface.DefaultStack); } //works fine
set { Set(nameof(Stack), DefaultStack, value); } //doesn't exist in the current context, why?
}
}
Why can't I access the constant in the StackContainer without "IInterface."?
PS: my purpose here is to place the const somewhere instead of StackContainer in order to have easy access to it. If it was defined in the StackContainer I could use it like this: StackContainer.DefaultStack, but it isn't a good decision, I think.