title: Do adding properties to an interface prevent creating private/protected "set" in derived types?
body: <p><strong>Edit:</strong> <em>It turns out I missed something obvious, but I'm going to leave the question open in case someone else makes the same obvious mistake. Thanks to those who pointed it out</em> <strong>See bottom for explanation.</strong></p>
  
  <p>Is it possible to have a non-public set on a property that is overriding an interface property?</p>
  
  <p>Perhaps I'm having a stupid moment, but it seems to me that having a property defined in an interface implicily requires that no deriving class may provide any non-public set for said property.</p>
  
  <p>Example:</p>
  
  <pre><code>interface IField
  {
      bool IsValid { get; }
  }
  </code></pre>
  
  <p>... and since interface properties may not have accessibility modifiers means that:</p>
  
  <pre><code>class Field : IField
  {
      public override bool IsValid { get; protected set; }
  }
  </code></pre>
  
  <p>...will not be possible despite the fact that it meets the interface requirements <em>conceptually</em>.</p>
  
  <p>IMO this has large negative implications for encapsulation that might be done via non-public Properties, and prevents a number of common use patters for Propertes.</p>
  
  <p>I'm aware that you can create a non-public SetIsValid member that modifies a common backing store, but that would create an inconsistent pattern and add what would otherwise be code noise were it not necessary.</p>
  
  <p><em>Have I missed something?</em></p>
  
  <hr>
  
  <p><strong>Edit: Yes I <em>have</em> missed something</strong></p>
  
  <p>I'm modifying someone else's code at the moment and just realize that the class I was wrestling with implemented the interface and derived from a base class. And I'm new to c# That's what caused the override confusion. </p>
  
  <p>the actual class looked like:</p>
  
  <pre><code>class Field : IField, BaseField
  {
      public override bool IsValid { get; protected set; }
  }
  </code></pre>
  
  <p>...where BaseField implemented the interface as well, but did not implement the set.</p>