Skip to content

Instantly share code, notes, and snippets.

View oscarryz's full-sized avatar

Oscar Reyes oscarryz

View GitHub Profile
@oscarryz
oscarryz / gist:3147119
Created July 19, 2012 21:55 — forked from yngwie74/gist:3144879
Obtener un log del SQL generado por un DataContext
private TRet WithLogging<T, TRet>(T context, string logmsg, Func<T, TRet> func) where T : DataContext
{
TRet result;
var temporal = new TemporalLogger.Create(logmsg, context.Log, Log);
try
{
context.Log = temporal.Log();
result = func.Invoke(context);