Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:53:07+00:00 2026-05-25T09:53:07+00:00

I am wanting to use the MVCMiniProfiler with Dapper. Is this possible beyond wrapping

  • 0

I am wanting to use the MVCMiniProfiler with Dapper. Is this possible beyond wrapping the “Query” call from dapper in “Using Profiler.Step” block?

I have this basic Dapper call:

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

The MiniProfiler examples show this

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

Where I am stuck is in the implementation of the “Get” on the ProfiledDbConnection. Is it possible to use ProfiledDbConnection while using Dapper?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:53:08+00:00Added an answer on May 25, 2026 at 9:53 am

    Good catch, the documentation is out of date, just updated it:

    Use something like:

    return MiniProfiler.Current != null ? 
            new MvcMiniProfiler.Data.ProfiledDbConnection(cnn, MiniProfiler.Current) : 
            cnn;
    

    I killed the factory cause I wanted people to be able to inherit off ProfiledDbConnection and statics can not be virtualized.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wanting to use jquery to do a show/hide of a DIV from
What are the big limitations with VB.Net that prevent people from wanting to use
I have this error when wanting to use the property ListaDimensiones in a controlled
I've got a full layout designed using 960.gs and am wanting to use it
I'm wanting to use QuickGraph to draw some graphs in C# using GraphViz. I've
I have an 3rd Party API I'm wanting to use from my Silverlight 4
I am wanting to use the phonegap audio api in GWT using JSNI.I cannot
I am wanting to use a amimated gif in gwt and remove it from
I am wanting to use MongoDB on my Windows Server and I am using
I'm wanting to use properties from other css classes without having to rewrite the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.