title: C# Loose coupling
body: <p>I can't explain my problem in English. so let me show my situation.</p>
  
  <pre><code>// in Main Project
  public class User
  {
      public int version
      {
          get;
          set;
      }
  }
  
  
  // in Common Project
  public class Service : BaseService
  {
      User _user;
      public void SetVersion(int versionID)
      {
          _user.version = versionID;
      }
  
      public bool HasMessage()
      {
          return GetMessage(user.version);
      }
  }
  </code></pre>
  
  <p>And now I have another sub project. and I need use Service class in there.
  so I wish make Service class independent from User class.</p>
  
  <p>how do I do that?</p>
  
  <p>I have only below solution. Is there any brilliant way?</p>
  
  <pre><code>public class Service : BaseService
  {
      Action&lt;int&gt; _getCallBack;
      Func&lt;int&gt; _setCallBack;
  
      public Service(Action&lt;int&gt; getCallback, Func&lt;int&gt; setCallBack)
      {
          _getCallback = getCallback;
          _setCallback = setCallback;
      }
  
      public void SetVersion(int versionID)
      {
          setCallback(versionID);
      }
  
      public bool HasMessage()
      {
           return GetMessage(getCallback())
      }
  }
  </code></pre>