title: Mapping list of objects
body: <p>I'm manually creating a mapper that converts a DAO object to a DTO. *** BTW, I'm aware of AutoMappers but I want to do this by hand for a few reasons.</p>
  
  <p>The mapper itself is not difficult. What I need help with is mapping a List. Do I need to handle each object mapping in a foreach loop or is there a better way to create a mapper that can handle both mapping a single object as well as a list of objects?</p>
  
  <p>My DAO object looks like this:</p>
  
  <pre><code>MyObjectDao
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>And let's say my DTO object looks like this:</p>
  
  <pre><code>MyObjectDto
  {
     public int Id { get; set; }
     public string Name { get; set; }
     public string SomeOtherProperty { get; set; }
  }
  </code></pre>
  
  <p>And my mapper is as simple as this:</p>
  
  <pre><code>public MyObjectDto ConvertFromDaoToDto(MyObjectDao daoObject)
  {
     MyObjectDto dtoObject = new MyObjectDto();
     dtoObject.Id = daoObject.Id;
     dtoObject.Name = dtoObject.Name;
  
     return dtoObject;
  }
  </code></pre>
  
  <p>As I mentioned above, I can go through a FOREACH loop to handle mapping of each DAO object to a DTO object but is there a better way to handle a list of objects?</p>