chanan / blazordb Goto Github PK
View Code? Open in Web Editor NEWIn memory, persisted to localstorage, database for .net Blazor browser framework
License: The Unlicense
In memory, persisted to localstorage, database for .net Blazor browser framework
License: The Unlicense
For example from EF Core: https://docs.microsoft.com/en-us/ef/core/saving/related-data
Hi,
your links to .cshtml files doesn't work in README.md.
TodoForm OnInitAsync is not getting called
Implement new storage format: https://github.com/chanan/BlazorDB/blob/master/docs/storageFormat.md
After adding two records to a StorageSet
, during setup of the BrowserServiceProvider
, and calling AddBlazorDB
, getting an IndexOutOfRangeException
:
Here's the full stack trace:
MonoPlatform.ts:70 Uncaught (in promise) Error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at BlazorDB.Storage.StorageManagerLoad.GetIdFromString (System.String stringToSearch, System.Int32 startFrom) <0x1b9bc28 + 0x0003c> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.FindIdInSerializedModel (System.String serializedModel) <0x1b9b6c8 + 0x0002a> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.LoadStringModels (System.Type contextType, System.Collections.Generic.IEnumerable`1[T] storageSets) <0x1b79508 + 0x000ea> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.LoadContextFromStorageOrCreateNew (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Type contextType) <0x1af14b0 + 0x0002c> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManager.LoadContextFromStorageOrCreateNew (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Type contextType) <0x1af0fa8 + 0x00020> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.RegisterBlazorDb (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Collections.Generic.IEnumerable`1[T] types) <0x1af08c0 + 0x0004e> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.Scan (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Reflection.Assembly assembly) <0x1a3c9a0 + 0x00022> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.AddBlazorDB (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Action`1[T] configure) <0x1a47f28 + 0x0006e> in <64e9d65131cb416192abd90ed76d00cb>:0
at ACMEBlazor.Program+<>c.<Main>b__2_0 (Microsoft.Extensions.DependencyInjection.IServiceCollection services) <0x1a47448 + 0x0003c> in <dbc4da5cd36641039edcb92d67a310f6>:0
at Microsoft.AspNetCore.Blazor.Browser.Services.BrowserServiceProvider..ctor (System.Action`1[T] configure) <0x18c3fd8 + 0x0003a> in <7da830e0eabd429898584695ab9fd9e5>:0
at ACMEBlazor.Program.Main (System.String[] args) <0x18c3928 + 0x00026> in <dbc4da5cd36641039edcb92d67a310f6>:0
at BlazorDB.Storage.StorageManagerLoad.GetIdFromString (System.String stringToSearch, System.Int32 startFrom) <0x1b9bc28 + 0x0003c> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.FindIdInSerializedModel (System.String serializedModel) <0x1b9b6c8 + 0x0002a> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.LoadStringModels (System.Type contextType, System.Collections.Generic.IEnumerable`1[T] storageSets) <0x1b79508 + 0x000ea> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManagerLoad.LoadContextFromStorageOrCreateNew (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Type contextType) <0x1af14b0 + 0x0002c> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.Storage.StorageManager.LoadContextFromStorageOrCreateNew (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Type contextType) <0x1af0fa8 + 0x00020> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.RegisterBlazorDb (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Collections.Generic.IEnumerable`1[T] types) <0x1af08c0 + 0x0004e> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.Scan (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Reflection.Assembly assembly) <0x1a3c9a0 + 0x00022> in <64e9d65131cb416192abd90ed76d00cb>:0
at BlazorDB.ServiceCollectionExtensions.AddBlazorDB (Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, System.Action`1[T] configure) <0x1a47f28 + 0x0006e> in <64e9d65131cb416192abd90ed76d00cb>:0
at ACMEBlazor.Program+<>c.<Main>b__2_0 (Microsoft.Extensions.DependencyInjection.IServiceCollection services) <0x1a47448 + 0x0003c> in <dbc4da5cd36641039edcb92d67a310f6>:0
at Microsoft.AspNetCore.Blazor.Browser.Services.BrowserServiceProvider..ctor (System.Action`1[T] configure) <0x18c3fd8 + 0x0003a> in <7da830e0eabd429898584695ab9fd9e5>:0
at ACMEBlazor.Program.Main (System.String[] args) <0x18c3928 + 0x00026> in <dbc4da5cd36641039edcb92d67a310f6>:0
at Object.callMethod (MonoPlatform.ts:70)
at Object.callEntryPoint (MonoPlatform.ts:47)
at Boot.ts:38
at step (UriHelper.ts:99)
at Object.next (UriHelper.ts:99)
at fulfilled (UriHelper.ts:99)
For example:
var person = new Person { FirstName = "Many", LastName = "Test" };
var address1 = new Address { Street = "Many test 1", City = "Saved as a reference" };
var address2 = new Address { Street = "Many test 2", City = "Saved as a reference" };
person.OtherAddresses = new List<Address> { address1, address2 };
Context.People.Add(person);
Context.SaveChanges();
Right now, in the above code snippet there is no navigation property from Address
to Person
. If one was added to Address
it would have to be manually set to the person instance:
var person = new Person { FirstName = "Many", LastName = "Test" };
var address1 = new Address { Street = "Many test 1", City = "Saved as a reference", Person = person };
var address2 = new Address { Street = "Many test 2", City = "Saved as a reference", Person = person };
person.OtherAddresses = new List<Address> { address1, address2 };
Context.People.Add(person);
Context.SaveChanges();
Make this automatic in SaveChanges()
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.