// ugly but does the job private static FileSystemPath FindEntitySubfolder(object key, FilesystemStorageOptions options) { var step = options.EntitiesPerDirectory; var root = options.BasePath; switch (key) { case byte b: return(root.Partition(b, step)); case short s: return(root.Partition(s, step)); case int i: return(root.Partition(i, step)); case long l: return(root.Partition(l, step)); #if !CLS case sbyte sb: return(root.Partition(sb, step)); case ushort us: return(root.Partition(us, step)); case uint ui: return(root.Partition(ui, step)); case ulong ul: return(root.Partition(ul, step)); #endif default: return(root.AppendDirectory(key.GetHashCode().ToString())); } }
public static FileSystemPath LocateKeyFile(object key, FilesystemStorageOptions options) { return(FindEntitySubfolder(key, options).AppendFile(KeyFilename)); }
public static FileSystemPath FindSnapshotFolder(object key, FilesystemStorageOptions options) { return(FindEntitySubfolder(key, options).AppendDirectory(SnapshotSubfolder)); }
public FilesystemEntityReaderWriter( IFileSystem filesystem, IFormatter <TInput, TOutput> formatter, FilesystemStorageOptions options) => (this.filesystem, this.formatter, this.options) =