0

Exception in EF Core 7 / SQLite with a code-first approach :

Table does not exist

Code is here with issue detail:

https://github.com/HumairaSid/EFCoreBasicCaching

I'm trying to create a SQLite database with Entity Framework Core 7.0 and a code-first approach.

Issue is table does not exist, it seems actual problem is database is not getting created by code.

I need your help

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 1
    Does this answer your question? [How to auto create database on first run?](https://stackoverflow.com/questions/42355481/how-to-auto-create-database-on-first-run) – Aron Apr 26 '23 at 05:29

1 Answers1

0

I have solved this issue by using

// Drop the database if it exists

 dbContext.Database.EnsureDeleted();

https://learn.microsoft.com/en-us/ef/core/managing-schemas/ensure-created I have added to my startup file