BlazorWasmSQLiteTest
Testing client-side SQLite in Blazor WebAssembly
Testing client-side SQLite in Blazor WebAssembly
Added new properties to ToDo class and
`public class Todo
{
[Key]
public int Id { get; set; }
public string Title { get; set; }
public bool IsComplete { get; set; }
public string Property1 { get; set; }
public string Property2 { get; set; }
public string Property3 { get; set; }
public string Property4 { get; set; }
public string Property5 { get; set; }
public string Property6 { get; set; }
}`
And modified ClientSideDbContext.cs
`protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Todo>().HasData(new Todo[]
{
new Todo { Id = 1, Title = "Todo 1", IsComplete = false, Property1 = "p1", Property2 = "p2", Property3 = "p3", Property4 = "p4", Property5 = "p5", Property6 = "p6"},
new Todo { Id = 2, Title = "Todo 2", IsComplete = false, Property1 = "p1", Property2 = "p2", Property3 = "p3", Property4 = "p4", Property5 = "p5", Property6 = "p6" },
new Todo { Id = 3, Title = "Todo 3", IsComplete = false, Property1 = "p1", Property2 = "p2", Property3 = "p3", Property4 = "p4", Property5 = "p5", Property6 = "p6" },
});
}`
The Exception is:
An exception occurred while iterating over the results of a query for context type 'BlazorWasmSQLiteTest.ClientSideDbContext'.
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: t.Property1'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
I have to manually delete the IndexedDB.SqliteStorage using F12 then reload the page, only then application is running fine and no more EF exception.
please advise, why does this happen whenever I added new properties?
thank you
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.