6
Dapper에서 MVCMiniProfiler를 사용하고 싶습니다. "Profiler.Step 사용"블록에서 dapper의 "Query"호출을 래핑 할 수 있습니까?Dapper with MVCMiniProfiler
Dim comments As List(Of Comment)
Using conn = New SqlConnection(ConnectionString)
conn.Open()
comments = conn.Query(Of Comment)("SELECT * from comments where userid = @userid", New With {.userid= 1})
End Using
MiniProfiler 예 내가 붙어있는 곳
Private Shared _sqlConnection As SqlConnection
Public Shared Function GetOpenConnection() As DbConnection
If _sqlConnection Is Nothing Then
_sqlConnection = New SqlConnection("connection string")
End If
' wrap the connection with a profiling connection that tracks timings
Return MvcMiniProfiler.Data.ProfiledDbConnection.[Get](_sqlConnection, MiniProfiler.Current)
End Function
가 ProfiledDbConnection에서 "가져 오기"의 구현에 보여
나는이 기본 말끔 전화를 가지고있다. Dapper를 사용하는 동안 ProfiledDbConnection을 사용할 수 있습니까?