public static IServiceCollection AddIndexedDB(this IServiceCollection serviceCollection, Action <DbStore> options) { var dbStore = new DbStore(); options(dbStore); serviceCollection.TryAddSingleton(new IndexedDBManager(dbStore)); return(serviceCollection); }
/// <summary> /// Set up the DbStore and creats an instance IndexedDBManager as a singleton /// </summary> /// <param name="services"></param> /// <param name="options">Action to set up the DbStore</param> /// <returns></returns> public static IServiceCollection AddIndexedDB(this IServiceCollection services, Action <DbStore> options, bool serverSide = false) { var dbStore = new DbStore(); options(dbStore); services.TryAddSingleton(dbStore); services.AddScoped <IndexedDBManager, IndexedDBManager>(); return(services); }
public IndexedDBManager(DbStore dbStore, IJSRuntime jsRuntime) { _dbStore = dbStore; _jsRuntime = jsRuntime; }
public IndexedDBManager(DbStore dbStore) { _dbStore = dbStore; }