✅ .NET 8 Identity with SQLite
I am trying to implement .NET identity using a SQLite database.
I've followed this tutorial which uses SQL Sever. Ive gotten up to 14:48 (run the app) where i tested the API using Swagger. I created an email and password that passed all the default requirements, but got a SQLite exception that a table didn't exist.
assume at some point in this tutorial i did something that was supposed to set up the tables for SQL Server, but it does not work for SQLite.
Here's what i did.
I created a DataContext that extends IdentityDbContext with a constructer that passes a DbContextOptions<DataContext> to the base constructer
i added these lines to my progam.cs
i added my connection string to appsettings.json:
i ran this on PowerShell in my project directory
I've got the following packages installed (related to my attempt to implement identity):
I've followed this tutorial which uses SQL Sever. Ive gotten up to 14:48 (run the app) where i tested the API using Swagger. I created an email and password that passed all the default requirements, but got a SQLite exception that a table didn't exist.
assume at some point in this tutorial i did something that was supposed to set up the tables for SQL Server, but it does not work for SQLite.
Here's what i did.
I created a DataContext that extends IdentityDbContext with a constructer that passes a DbContextOptions<DataContext> to the base constructer
i added these lines to my progam.cs
i added my connection string to appsettings.json:
i ran this on PowerShell in my project directory
I've got the following packages installed (related to my attempt to implement identity):
- Microsoft.AspNetCore.Identiy.EntityFrameworCore
- Microsoft.EntityFrameworkCore.Design
- Microsoft.EntityFrameworkCore.Sqlite
- Microsoft.EntityFrameworkCore.Tools
YouTubePatrick God
Join the .NET Web Academy: https://learn.dotnetwebacademy.com
Support me on Patreon for exclusive source code access: https://patreon.com/_PatrickGod
Get the .NET 8 Web Dev Jump-Start Course for FREE: https://dotnet8.patrickgod.com
Let's get social on Twitter/X: https://twitter.com/_PatrickGod
Let's connect on LinkedIn: https://www.li...
