public static IServiceCollection AddBlazorDB(this IServiceCollection services, Action<DbStore> options)
 {
     var dbStore = new DbStore();
     options(dbStore);
     
     services.AddTransient<DbStore>((_) => dbStore);
     services.TryAddSingleton<IBlazorDbFactory, BlazorDbFactory>();
     
     return services;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="dbStore"></param>
 /// <param name="jsRuntime"></param>
 internal IndexedDbManager(DbStore dbStore, IJSRuntime jsRuntime)
 {
     _objReference = DotNetObjectReference.Create(this);
     _dbStore      = dbStore;
     _jsRuntime    = jsRuntime;
 }
Exemplo n.º 3
0
 public Task <IndexedDbManager> GetDbManager(DbStore dbStore)
 => GetDbManager(dbStore.Name);