title: C# equivalent to C++ friend keyword?
body: <p>I am new to C#, and I have a problem for which in C++ I would normally use the <code>friend</code> identifier. Now I know the <code>friend</code> keyword doesn't exist in C#, but I don't have any experience with how to work around this (except for making all class variables public properties, which I want to avoid if I can).</p>
  
  <p>I have the following scenario:</p>
  
  <pre><code>public class A 
  {
      public string Info { get; set; }
      /* much more data */
  }
  
  public class B
  {
      private A m_instanceOfA;
  
      public B(A a) { m_instanceOfA = a; }
  
      public Info { get return A.info; set A.Info  = value; }
  
      /* And some more data of its own*/
  }
  
  public class C
  {
      private A m_instanceOfA;
  
      // I need a constructor of C, which needs to set C.m_instanceOfA
      // to the same value as b.m_instanceOfA.
      public C(B b) { m_instanceOfA = b.m_instanceOfA ; } // &lt;--- Not allowed!
  
      /* And some more data of its own*/
  }
  </code></pre>
  
  <p>Is there any other clever way, without making <code>B.m_instanceOfA</code> public, to give <code>C</code> access to this variable (only in the constructor)?</p>