private void LogIfNonAsync <TResult>( DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext) { if (!interceptionContext.IsAsync) { XenLoggerService.LogWarning(string.Format("Non-async command used: {0}", command.CommandText)); } }
private void LogIfError <TResult>( DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext) { if (interceptionContext.Exception != null) { XenLoggerService.LogError(string.Format("Command {0} failed with exception {1}", command.CommandText, interceptionContext.Exception), "Entity Framework"); } }