I have an Interface that has only one property like below
public interface IExtendable
{
Hashtable ExtendedProperties { get; set;}
}
I want setter to be private but it doesnt allow because its coming from an Interface and everyhing should be public in it as I know.
So what can be the best practice to allowing private setter ?
- Dont use Interface in this scenario or what ?
Thanks in advance,
You can not add a private setter to an interface. If you want to have a private setter, then your interface will need to look like this:
And in the implementation of the interface you can add your private setter.