✅ .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):
- Microsoft.AspNetCore.Identiy.EntityFrameworCore
- Microsoft.EntityFrameworkCore.Design
- Microsoft.EntityFrameworkCore.Sqlite
- Microsoft.EntityFrameworkCore.Tools
This is my first foray into Data Contexts and Entity Framework. I am still not quite sure what ether are.
Patrick God
YouTube
.NET 8 Authentication with Identity in a Web API with Bearer Tokens...
🚀 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...
8 Replies
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
i see. testing...
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
worked! not sure how i missed that... Thanks!
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
should have. :/