コード例 #1
0
        public static IServiceCollection AddIndexedDB(this IServiceCollection serviceCollection, Action <DbStore> options)
        {
            var dbStore = new DbStore();

            options(dbStore);
            serviceCollection.TryAddSingleton(new IndexedDBManager(dbStore));

            return(serviceCollection);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 public IndexedDBManager(DbStore dbStore, IJSRuntime jsRuntime)
 {
     _dbStore   = dbStore;
     _jsRuntime = jsRuntime;
 }
コード例 #4
0
 public IndexedDBManager(DbStore dbStore)
 {
     _dbStore = dbStore;
 }