Note that there are some explanatory texts on larger screens.

plurals
  1. POPass Parameters To Dapper List
    primarykey
    data
    text
    <p>Need to know the best practice for passing multiple parameters to a dapper list function I need to pass the @StartDate, @EndDate, @AgentId, @Crc passed into the posted method but not sure exactly how to do it using Dapper. Thanks in advance</p> <pre><code> public List&lt;CallSearchRepositoryBO&gt; GetCallSearchRecords(DateTime startDate, DateTime endDate, int agentId, string crc) { try { using (IDbConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["CCWorkforceConnectionString"].ConnectionString)) { var items = connection.Query&lt;CallSearchRepositoryBO&gt; ("SELECT h.historyid " + " ,h.Dialid " + " ,h.Crc " + " ,c.szExternalId ExternalId " + " ,a.AgentId " + " ,UPPER(a.LastName +',' +a.FirstName) Agent" + " ,c.ContactId" + " ,CallDateTime" + " ,h.ProjName Campaign" + " ,h.PhoneNum PhoneNumber" + " ,szQ01 Q1" + " ,szQ02 Q2" + " ,szQ03 Q3" + " ,szQ04 Q4" + " ,szQ05 Q5" + " ,szQ06 Q6" + " ,szQ07 Q7" + " ,szQ08 Q8" + " ,szQ09 Q9" + " ,szQ10 Q10" + " ,txtQ33 Comments" + " ,szFaxType AlertType" + " ,r.VoxFilePath+VoxFileName RecordingPath" + " ,r.RecLength" + " ,CASE WHEN DataLength(txtQ33) &gt; 0 THEN 1 ELSE 0 END HasComments " + " FROM Touchstar..History h" + " INNER JOIN Touchstar..Agent a WITH(NOLOCK) ON h.AgentId = a.AgentId" + " INNER JOIN Touchstar..Recording r WITH(NOLOCK) ON h.HistoryId = r.HistoryId" + " LEFT JOIN Touchstar..Contact c WITH(NOLOCK) ON h.DialId = c.DialId" + " LEFT JOIN Touchstar..Sales s WITH(NOLOCK) ON c.ContactId = s.ContactId" + " WHERE h.CallDateTime BETWEEN @StartDate AND @EndDate" + " AND h.AgentId=@AgentId"+ " AND h.Crc=@Crc," + " AND c.szCampaignId IN('UP2','UP4')" + " ORDER BY CallDateTime DESC").ToList(); return items; } } catch (Exception) { throw; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload