Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Using MiniProfiler with SisoDb

Daniel Wertheim edited this page Nov 29, 2012 · 4 revisions

The first thing to do is to install that the SisoDb.MiniProfiler package through NuGet.

Next step is to slightly modify the code where you create your ISisoDatabase:

To get access to the extension method that lets you activate the profiler, you first need to import a namespace from SisoDb.MiniProfiler:

using SisoDb.MiniProfiler; 

The final step is to activate the profiler using our extension method db.ActivateProfiler.

var cnInfo = new Sql2008ConnectionInfo(
    @"Data source=.\sqlexpress;Initial catalog=SisoDb.Profiling;Integrated security=SSPI;");
var db = new Sql2008DbFactory().CreateDatabase(cnInfo);

db.ActivateProfiler();

You can also turn the profiler off, by using the extension method: db.DeactivateProfiler().

Output the profiling information

Beside this you will have to set up MiniProfiler in your application too. For instructions on how to do that refer to the official MiniProfiler documentation. http://code.google.com/p/mvc-mini-profiler/