Skip to content

Instantly share code, notes, and snippets.

@taylonr
Created December 15, 2011 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taylonr/1481506 to your computer and use it in GitHub Desktop.
Save taylonr/1481506 to your computer and use it in GitHub Desktop.
DataProfiler Implementation
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