anchor.diff:      let SettingsFileExtension = ".yml"
       
       let CaseInsensitiveKeywordAnalyzer = 
  -        CustomAnalyzer.Builder().withTokenizer("keyword").addTokenFilter("lowercase").build()
  +        CustomAnalyzer.Builder().withTokenizer("keyword").addTokenFilter("lowercase").build() :> FlexLucene.Analysis.Analyzer
   
   type Error = 
       // Generic Validation Errors
  
positive.code:     let inline tryAdd<'T> (key, value : 'T) (dict : ConcurrentDictionary<string, 'T>) = dict.TryAdd(key, value)
      let inline add<'T> (key, value : 'T) (dict : ConcurrentDictionary<string, 'T>) = dict.TryAdd(key, value) |> ignore
      
      let inline addOrUpdate<'T> (key, value : 'T) (dict : ConcurrentDictionary<string, 'T>) = 
          match dict.TryGetValue(key) with
          | true, v -> dict.TryUpdate(key, value, v) |> ignore
  
negative.code:         if Path.GetExtension(path) <> Constants.SettingsFileExtension then path + Constants.SettingsFileExtension
          else path
      
      member __.DeleteFile(filePath) = 
          let path = getPathWithExtension (filePath)
          if File.Exists(path) then 
              use mutex = new Mutex(false, path.Replace("\\", ""))
              File.Delete(path)
          ok()
      
      member __.ReadFile<'T>(filePath) = 
          let path = getPathWithExtension (filePath)
          if File.Exists(path) then 
              try 
                  use stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
                  let response = formatter.DeSerialize<'T>(stream)
                  ok <| response
              with e -> fail <| FileReadError(filePath, exceptionPrinter e)
          else fail <| FileNotFound(filePath)
      
      member __.WriteFile<'T>(filePath, content : 'T) = 
          let path = getPathWithExtension (filePath)
          use mutex = new Mutex(true, path.Replace("\\", ""))
          Directory.CreateDirectory(Path.GetDirectoryName(path)) |> ignore
          try 
              mutex.WaitOne(-1) |> ignore
              use file = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read)
              let byteContent = System.Text.UTF8Encoding.UTF8.GetBytes(formatter.SerializeToString(content))
              file.Write(byteContent, 0, byteContent.Length)
              mutex.ReleaseMutex()
              ok()
          with e -> 
              mutex.ReleaseMutex()
              fail <| FileWriteError(filePath, exceptionPrinter e)
  
  [<Sealed>]
  type DtoStore<'T>(fileWriter : ThreadSafeFileWiter) = 
      let store = conDict<'T>()
      
      let getFolderName (typeName : string) = 
          let parts = typeName.Split([| '.'; '+' |], StringSplitOptions.RemoveEmptyEntries)
          if parts.Last() = "Dto" then parts.[parts.Length - 2]
          else parts.Last()
      
      let folderPath = Constants.ConfFolder +/ (getFolderName (typeof<'T>.FullName))
      
      member __.UpdateItem<'T>(key : string, item : 'T) = 
          let path = folderPath +/ key
          match store |> tryUpdate (key, item) with
          | true -> fileWriter.WriteFile(path, item)
          | false -> fail <| StoreUpdateError
      
      member __.DeleteItem<'T>(key : string) = 
          let path = folderPath +/ key
          match store.TryRemove(key) with
          | true, _ -> fileWriter.DeleteFile(path)
          | _ -> fail <| StoreUpdateError
      
      member __.GetItem(key : string) = 
          match store.TryGetValue(key) with
          | true, value -> ok <| value
          | _ -> fail <| KeyNotFound(key)
      
      member __.GetItems() = store.Values.ToArray()
      member __.LoadItem<'T>(key : string) = 
          match fileWriter.ReadFile<'T>(folderPath +/ key) with
          | Choice1Of2(item) -> 
              tryAdd (key, item) |> ignore
              ok()
          | Choice2Of2(error) -> fail <| error
  