Пример #1
0
 public void Record(string path)
 {
     lock (_lock)
     {
         var request = _repo.GetByPath(path);
         if (request != null)
         {
             request.IncrementCount();
         }
         else
         {
             request = new NotFoundRequest(path);
             request.IncrementCount();
             _repo.Add(request);
         }
     }
 }
        public void Record(string path)
        {
            string lowerPath = path.ToLowerInvariant();

            lock (_lock)
            {
                var request = _repo.GetByPath(lowerPath);
                if (request != null)
                {
                    request.IncrementCount();
                }
                else
                {
                    request = new NotFoundRequest(lowerPath);
                    request.IncrementCount();
                    _repo.Add(request);
                }
            }
        }