title: Avoiding circular references between a models project and a contracts project
body: <p>This isn't a novel question (<a href="https://stackoverflow.com/questions/3081070/asp-net-mvc-how-to-avoid-circular-reference-between-2-projects">ref</a>), but I'd like to make an attempt at asking the question more succinctly to elicit a better response.</p>
  
  <p>I'm currently working on a WCF application with a co-worker and we've separated our code into separate projects. Our structure looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/1hFFo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1hFFo.png" alt="enter image description here"></a></p>
  
  <p>Each collapsed folder follows the above convention.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>The circular reference problem occurs between the <strong>.Models</strong> projects and our <strong>.Contracts</strong> projects since an interface often references a model and visa versa. </p>
  
  <p>I'll demonstrate what I mean with a simple example.</p>
  
  <p><strong>For Example</strong></p>
  
  <p>In the example below I created two very simple projects. One project for the <em>models</em> and one for the <em>interfaces</em>. </p>
  
  <p><a href="https://i.stack.imgur.com/ZpFIG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZpFIG.png" alt="enter image description here"></a></p>
  
  <p>Starting with a type that models an common object for us, for example:</p>
  
  <pre><code>namespace Example.Models
  {
      public class MyType
      {
          public int Id { get; set; }
      }
  } // project 1
  </code></pre>
  
  <p>Then we often make another object that contains a list of that type:</p>
  
  <pre><code>namespace Example.Models
  {
      public class AnotherType : ISomeInterface // let's add an interface!
      {
          public List&lt;MyType&gt; MyProperty { get; set; }
      }
  } // project 1
  </code></pre>
  
  <p>This works just fine until we decide to wire up an interface for this <code>AnotherType</code> class in our other project.</p>
  
  <pre><code>namespace Example.Contracts
  {
      interface ISomeContract
      {   
          List&lt;MyType&gt; MyProperty { get; set; } 
      }
  } // project 2
  </code></pre>
  
  <p>Obviously, in order to add <code>MyType</code> to our <strong>Example.Contracts</strong> project, we need to add a reference to our <strong>Example.Models</strong> project. Conversely, in order to add <code>ISomeContract</code> to our <code>AnotherType</code> class we need to add a reference to the <strong>Example.Contracts</strong> project.</p>
  
  <p>So we've got ourselves a circular reference.</p>
  
  <h2>My Question</h2>
  
  <p>In the given scenario, is there a conventional way to avoid this circular reference issue? Or is this flawed by design?</p>
  
  <p>Here's the simple <a href="http://beaulieu.blob.core.windows.net/images/General/20160513151026Example.Contracts.zip.zip" rel="nofollow noreferrer">Example project</a> for anyone interested</p>