reshiru / blazor.indexeddb.framework Goto Github PK
View Code? Open in Web Editor NEWA framework for blazor which acts as an interface to IndexedDB
License: MIT License
A framework for blazor which acts as an interface to IndexedDB
License: MIT License
Based on https://github.com/Fody/Fody
Test if possible (may be restricted...)
Replace DotNetObjectRef with DotNetObjectReference in .NET Core 3.0 Preview 9 - https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-9/
After implementing custom connector switch the language to C# 8.0 asap to use IAsyncEnumerable (async yield results) for IndexedSet
If I try to access the database from the OnAfterRenderAsync lifecycle method, or binding to a method that accesses the database, the following exception is thrown:
One or more errors occurred. (JSRuntime must be set up correctly and must be an instance of JSRuntimeBase to use DotNetObjectRef.)
With the following stack trace:
at Microsoft.JSInterop.DotNetObjectRefManager.get_Current()
at Microsoft.JSInterop.DotNetObjectRef`1..ctor(TValue value)
at Microsoft.JSInterop.DotNetObjectRef.Create[TValue](TValue value)
at TG.Blazor.IndexedDB.IndexedDBManager.OpenDb()
at TG.Blazor.IndexedDB.IndexedDBManager.EnsureDbOpen()
at TG.Blazor.IndexedDB.IndexedDBManager.GetRecords[TResult](String storeName)
at Blazor.IndexedDB.Framework.Extensions.TaskExtensions.InvokeAsyncWithResult(MethodInfo this, Object obj, Object[] parameters)
at Blazor.IndexedDB.Framework.IndexedDb.GetRows(Type propertyType, String storeName)
at Blazor.IndexedDB.Framework.IndexedDb.LoadData()
at Blazor.IndexedDB.Framework.IndexedDb.WaitForConnection()
at Blazor.IndexedDB.Framework.IndexedDbFactory.CreateT
However, if I call the same method from a button click it works as expected.
I installed the NuGet package and followed the code samples provided, but when I attempted to run the site I get the following error message:
InvalidOperationException: Error while validating the service descriptor 'ServiceType: Blazor.IndexedDB.Framework.IIndexedDbFactory Lifetime: Singleton ImplementationType: Blazor.IndexedDB.Framework.IndexedDbFactory': Cannot consume scoped service 'Microsoft.JSInterop.IJSRuntime' from singleton 'Blazor.IndexedDB.Framework.IIndexedDbFactory'.
In the Startup.cs file, if I add the library as a transient (i.e. services.AddTransient<IIndexedDbFactory, IndexedDbFactory>();) then my site will load but when I try to call the create method I get an error about TimeGhost not being found in the window. I tried searching online for anything about TimeGhost but had no luck.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.