public bool TryExecuteDynamicQuery(EntitySession session, LinqCommand command, out object result) { result = null; if (!CheckFullSetCacheCurrent(session)) { return(false); } var cmdInfo = command.Info; //try getting previously compiled version or compile it var cacheQuery = GetCacheQuery(command); if (cacheQuery == null) { return(false); } var start = _timeService.ElapsedMilliseconds; result = cacheQuery.CacheFunc(session, this, command.ParameterValues); var end = _timeService.ElapsedMilliseconds; var logEntry = new CacheQueryLogEntry(session.Context, cacheQuery.LogString, command.ParameterValues, _timeService.UtcNow, end - start, GetRowCount(result)); session.AddLogEntry(logEntry); session.Context.EntityCacheVersion = CurrentVersion; return(true); }
protected void LogComment(EntitySession session, string comment, params object[] args) { if (!session.LogEnabled) { return; } var entry = new InfoLogEntry(session.Context.LogContext, comment, args); session.AddLogEntry(entry); }
private void LogCommand(EntitySession session, IDbCommand command, long executionTime, int rowCount = -1) { if (session.LogDisabled) { return; } var entry = new DbCommandLogEntry(session.Context, command, DbModel.Driver.CommandCallFormat, _timeService.UtcNow, executionTime, rowCount); session.AddLogEntry(entry); }
protected void LogException(EntitySession session, Exception ex) { if(!session.LogEnabled) return; var entry = new ErrorLogEntry(session.Context, ex); session.AddLogEntry(entry); }
private void LogCommand(EntitySession session, EntityCommand command, object[] args, CacheType cachingType, long time, int rowCount) { var logEntry = new CacheCommandLogEntry(session.Context, command.CommandName, args, _timeService.UtcNow, time, rowCount, cachingType); session.AddLogEntry(logEntry); }
protected void LogException(EntitySession session, Exception ex) { var entry = new ErrorLogEntry(session.Context, ex); session.AddLogEntry(entry); }
private void LogCommand(EntitySession session, IDbCommand command, long executionTime, int rowCount = -1) { if (session.LogDisabled) return; var entry = new DbCommandLogEntry(session.Context, command, DbModel.Driver.CommandCallFormat, _timeService.UtcNow, executionTime, rowCount); session.AddLogEntry(entry); }
protected void LogComment(EntitySession session, string comment, params object[] args) { if (session.LogDisabled) return; var entry = new InfoLogEntry(session.Context, comment, args); session.AddLogEntry(entry); }