title: Data Transfer Objects and Entity Framework
body: <p>I am working on a 3-tier web application where I am using the microsoft Entity Framework.
  To make a loose coupling between the different layers I using data transfer objects to transfer between the Entity Framework objects and my custom objects, but I have a problem with the speed of translating between the entity framework and my custom DTO's.
  I use this method to transfer from EF to DTO:</p>
  
  <p><code>
  public List Transform(List carModelDefinition)
  {</p>
  
  <pre><code>        List&lt;CarDefinitionDTO&gt; cdDTOList = new List&lt;CarDefinitionDTO&gt;();
          foreach (DataLayer.CarModelDefinition cmd in carModelDefinition)
          {
              CarDefinitionDTO cdDTO = new CarDefinitionDTO();
              cdDTO.CarDefinitionId = cmd.CarModelDefinitionId;
              cdDTO.Compagny = cmd.Company;
              cdDTO.Model = cmd.Model;
              cdDTOList.Add(cdDTO);
          }
          return cdDTOList;
  
  }
  </code></pre>
  
  <p></code></p>
  
  <p>But when I try to transfer a list of e.g. 600 elements i takes about 10+ seconds. Am I doing something wrong, or is the speed simply this slow? 
  NB. I am working on a pretty fast PC so it is not the speed of my pc which slows it down.</p>