Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Web App (.net 8) - switch user authentication to use SQLite instead of SQL Server

$
0
0

I am trying to see if switching from using SQL Server to SQLite for the built in user authorization / authentication in the demo Blazor web app (on .NET 8).

I used the following as a base

https://www.syncfusion.com/faq/blazor/general/how-do-i-implement-authentication-using-sqlite-in-blazor

I changed the appsettings.json file

"DefaultConnection": "c:\\MyDir\\MyUsers.db"

I changed the builder.Services reference in Program.cs:

// builder.Services.AddDbContext<ApplicationDbContext>(options =>                options.UseSqlServer(connectionString));builder.Services       .AddDbContext<ApplicationDbContext>(options => options.UseSqlite(connectionString));

I uninstalled Microsoft.EntityFrameworkCore.SqlServer and installed Microsoft.EntityFrameworkCore.Sqlite.

I now get x3 errors in the ApplicationDbContextModelSnapshot.cs file (all same error)

Error CS0103
The name 'SqlServerModelBuilderExtensions' does not exist in the current context MyAppName

I am not sure how to go about modifying this to eliminate the error. The Syncfusion example was from an earlier version of .NET - so it does not apply directly.x 3


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>