namespace StorageServer.IO; using StorageServer.Models; public class DatabaseFactory : IDisposable { private IDatabase database; public DatabaseFactory(string fileName) { this.database = new FileDatabase(fileName); } public void Dispose() { this.database.Dispose(); } public long Create(FileModel model) { return this.database.Insert(model); } public FileModel Read(long id) { return this.database.Select(id); } public IEnumerable ReadAll() { return this.database.SelectAll(); } public bool Update(FileModel model) { return this.database.Update(model); } public bool Delete(long id) { return this.database.Delete(id); } }