Created
December 15, 2011 15:33
-
-
Save taylonr/1481506 to your computer and use it in GitHub Desktop.
DataProfiler Implementation
This file contains 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
public class DataProfiler : ISqlProfiler | |
{ | |
public DataProfiler() | |
{ | |
Enabled = true; | |
} | |
public bool Enabled { get; set; } | |
public void Update(PetaPocoSqlInfo info) | |
{ | |
CurrentRequestInfo.Add(info); | |
} | |
public const string PetaKey = "__petaPocoSqlInfo"; | |
public static List<PetaPocoSqlInfo> CurrentRequestInfo | |
{ | |
get | |
{ | |
if (HttpContext.Current.Items[PetaKey] == null) | |
HttpContext.Current.Items[PetaKey] = new List<PetaPocoSqlInfo>(); | |
return (List<PetaPocoSqlInfo>)HttpContext.Current.Items[PetaKey]; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment