Beispiel #1
0
 public void AddIfNotExist(string key, Toc toc)
 {
     if (!_values.TryAdd(key, toc))
     {
         _logger.Information("Duplicate Toc {key} new value not set {@toc}.", key, toc);
     }
 }
Beispiel #2
0
 public void AddOrReplace(string key, Toc toc)
 {
     if (!_values.TryAdd(key, toc))
     {
         _values[key] = toc;
         _logger.Information("Replace Toc {key}.", key);
     }
 }
Beispiel #3
0
        public Toc FindOrAdd(string key)
        {
            if (!_values.TryGetValue(key, out var value))
            {
                _logger.Information("{key} Toc not found. Creating.", key);
                var newValue = new Toc(key);
                value = _values.GetOrAdd(key, newValue);
            }

            return(value);
        }
Beispiel #4
0
 public bool Equals(Toc other)
 {
     return(Code == other.Code);
 }
Beispiel #5
0
 public bool IsValid(Toc toc) => NoFilter || Tocs.Contains(toc.Code);