title: Automapper vs Dapper for mapping
body: <p>This question is to verify if the current implementation is the right way to go about in terms of best practices and performance. So far in all my previous companies I have been using Auto Mapper to map relational objects to domain model entities and domain model entities to Dtos. The ORM tools have been Entity framework.
  In my current company they are using Dapper as ORM tool and do not use AutoMapper as they say Dapper does the mapping for you internally. So the way they have structured the project is create a separate class library project that contains Dtos and reference the Dtos in Dataccess and Business layer. 
  The query returned by Dapper is internally mapped to the Dtos. These Dtos are returned to the Business layer and so on.</p>
  
  <p>For example </p>
  
  <p>In the code below the Participant function is Dto.</p>
  
  <p><strong>Repository file in DataAccess layer</strong></p>
  
  <pre><code> public List&lt;ParticipantFunction&gt; GetParticipantFunctions(int workflowId)
          {
              // Update the Action for Participant
              string selectSql = @"SELECT [WFPatFunc_ID] AS WFPatFuncID
                          ,[WFFunction]
                          ,[SubIndustryID]
                          ,[DepartmentID]
                      FROM [dbo].[WF_ParticipantsFunctions]
                      WHERE [DepartmentID] = (SELECT TOP 1 [DepartmentID] FROM [dbo].[WF] WHERE [WF_ID] = @workflowId)";
  
              return _unitOfWork.GetConnection().Query&lt;ParticipantFunction&gt;(selectSql, new
              {
                  workflowId = workflowId
              }).ToList();
          }
  </code></pre>
  
  <p>The reason what I have been told by the developers is that AutoMapper would be just an overhead and reduce speed and since Dapper does mapping internally, there is no need for it.</p>
  
  <p>I would like to know if the practice they are following is fine and have no issues.</p>