title: How should domain classes be designed?
body: <p>I want to present an example and some requirements and want to understand what the best domain model should should.</p>
  
  <p>The DB is:</p>
  
  <pre><code>One Country has Many Cities.
  One City has many Towns
  </code></pre>
  
  <p>Both tables have Id column.</p>
  
  <p>In my C#, I have</p>
  
  <pre><code>public class Country
  {
    public List&lt;City&gt; Cities {get;set;}
    public int Id;
  }
  
  public class City
  {
    public int Id {get;set;}
    public int CountryId {get;set;}
  }
  </code></pre>
  
  <ol>
  <li>When I want to update a City, I can just take the Id of the country
  and update it. So this design works. </li>
  <li><p>When I want to insert a new
      City, I can take city object and insert it in Db. So this design
      works.</p></li>
  <li><p>When I want to delete a city, I take the Id of city and
          delete it from Db. So this design works.</p></li>
  <li><p>When I want to show a city,
      I also need country column in the grid in UI so this design doesn't work.</p></li>
  </ol>
  
  <p>I would then get country of each city from the country id column and that's painful.</p>
  
  <p>If I had Country has a property of City class then I would have to create Country object for all city objects and I don't need the country object during update, insert and delete - I just need CountryId.</p>
  
  <p>So my question is:</p>
  
  <ul>
  <li>How should I design them? </li>
  <li>Should I create a CountryName property in
  City class?</li>
  <li>Should I try another approach that you recommend?</li>
  </ul>