Building the ISQLiteStorage interface
Now we must set up another class, which will be used to control the queries performed on the database. Add a new file called ISQLiteStorage.cs
into the Storage
folder and implement the following:
public interface ISQLiteStorage { void CreateSQLiteAsyncConnection(); Task CreateTable<T>(CancellationToken token) where T : class, IStorable, new(); Task InsertObject<T>(T item, CancellationToken token) where T : class, IStorable, new(); Task<IList<T>> GetTable<T>(CancellationToken token) where T : class, IStorable, new(); Task<T> GetObject<T>(string key, CancellationToken token) where T : class, IStorable, new(); Task ClearTable<T>(CancellationToken token) where T : class, IStorable, new(); Task DeleteObjectByKey<T>(string key, CancellationToken token) where T : class, IStorable, new(); void CloseConnection(); }
The preceding...