internal static void AddTraceToTraceList(TraceDto trace) { if (TraceList.ContainsKey(trace.Writer)) { TraceList[trace.Writer].Enqueue(trace); } else { var traceWriterList = new ConcurrentQueue <TraceDto>(); traceWriterList.Enqueue(trace); TraceList.Add(trace.Writer, traceWriterList); } CalculateWriterSize(trace); SparseWriter(trace.Writer); }
public string Execute(Dictionary <string, string> parameterList) { if (ExecuteFunction == null) { return("Error function, no valid function registered!"); } try { var s = ExecuteFunction(parameterList); TraceList.Add(DateTime.UtcNow, s); if (TraceList.Count > TraceCount) { var d = TraceList.FirstOrDefault(); TraceList.Remove(d.Key); } return(s); } catch (Exception ex) { return(ex.Message); } }
public int ExecuteNonQuery() { ExecutorMethod = "ExecuteNonQuery"; TraceList.Add(this); return(0); }
public object ExecuteScalar() { ExecutorMethod = "ExecuteScalar"; TraceList.Add(this); return(ExpectedCommandResult); }
public DbDataReader ExecuteReader(CommandBehavior behavior) { ExecutorMethod = $"ExecuteReader(CommandBehavior.{behavior})"; TraceList.Add(this); return((TestDataReader)ExpectedCommandResult); }
public DbDataReader ExecuteReader() { ExecutorMethod = "ExecuteReader"; TraceList.Add(this); return((TestDataReader)ExpectedCommandResult); }