public void AddRequestLog(string action) { Context.Send(o => { var keyvalue = RequestLog.FirstOrDefault(kv => kv.Key == action); if (keyvalue != null) { keyvalue.Value++; } else { var keyVal = new KeyValue { Key = action, Value = 1 }; RequestLog.Add(keyVal); } }, null); }