title: Complex domain model based on companies and not users
body: <p>I have a few different types of companies that can access my web application e.g</p>
  
  <p>Different types of Companies:</p>
  
  <p>Client
  Supplier
  Agent</p>
  
  <p>Each have their own table in the database, linked to the main table Company which stores all common data e.g. Address, Tel, Email, TypeOfCompany with a FK to the relevant table (Client etc.)...</p>
  
  <p>What is the best way to handle this OO throughout my app?</p>
  
  <p>I currently do something like:</p>
  
  <pre><code>public class CompanyDTO
  {
    public int Id {get;set;}
    public string Name {get;set;}
    public Address Address {get;set;}
    public string Type {get;set;} //type of company
    //etc...
  }
  </code></pre>
  
  <p>then inherit from that class and add aditional properties e.g.</p>
  
  <pre><code>public class ClientDTO : CompanyDTO
  {
   public string Key {get;set;}
   public Address Billing {get;set;}
  }
  </code></pre>
  
  <p>However I am finding it problematic at times for example </p>
  
  <ol>
  <li><strong>Supplier user</strong> wants to access: AllCompanies, - show a list of all companies</li>
  <li>Then the <strong>user from the Supplier Company</strong> wants to view a <strong>specific</strong> companies detail, now if it is a client I will need to show ClientDTO or SupplierDTO? In this instance I want to show that specific companies <strong>Full details</strong></li>
  </ol>
  
  <p>What would be the best way to handle this?</p>
  
  <p>e.g. <code>GetCompanyByID(int companyid);</code> or <code>GetClientByID(int clientid);</code> What type of object should I return in both instances, presuming I want Client details in both instances...</p>