Dotnet Core Web API throws when trying to use SQLite for my application
DbContextOptionsBuilder' does not contain a definition for 'UseSqlite' and no accessible extension method 'UseSqlite'
how to fix this?
I have tried using.Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
I solved this problem by adding SQLite package.
On your startup file use this
using Microsoft.EntityFrameworkCore;
On your project file use this
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1"/>
then you are ready to use SQLite
services.AddDbContext<DataContext>(x =>
x.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With