Created
July 29, 2011 18:36
-
-
Save kurtschindler/1114428 to your computer and use it in GitHub Desktop.
Glimpse Plugin for NHibernate SQL logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Glimpse.Core.Extensibility.GlimpsePluginAttribute()] | |
public class NHGlimpsePlugin : IGlimpsePlugin | |
{ | |
public object GetData(HttpContextBase context) | |
{ | |
var data = new List<object[]> { new[] { "Key", "Value" } }; | |
data.Add(new object[] { "*count*", SqlLogger.Count }); | |
foreach (var sqlString in SqlLogger.All()) | |
{ | |
data.Add(new object[] { "*sql*", sqlString }); | |
} | |
return data; | |
} | |
public void SetupInit() { } | |
public string Name { get { return "NHibernate"; } } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment