title: C# internal getter, protected setter with an internal class parameter
body: <p>I was having the problem of wanting a property to have an internal getter and a protected setter, as described in <a href="https://stackoverflow.com/questions/1063901/why-is-internal-protected-not-more-restrictive-than-internal">this question</a>, and I thought I solved that by doing the following:</p>
  
  <pre><code>public class Accessor : AccessorBase
  {
      private Connection _connection;
  
      protected void setConnection(Connection value)
      {
          _connection = value;
      }
  
      internal Connection GetConnection()
      {
          return _connection;
      }
      ...
  }
  </code></pre>
  
  <p>However, I'm now getting this error:</p>
  
  <blockquote>
    <p>Inconsistent accessibility: parameter type 'Connection' is less accessible than method 'setConnection(Connection)'</p>
  </blockquote>
  
  <p>This is because I have <code>internal class Connection</code>.  I would rather not make <code>Connection</code> a public class, while <code>Accessor</code> <em>needs</em> to be public, so how can I get around this error while still maintaining an internal getter and a protected setter?</p>