Reputation: 11
Thanks in advance for your help.
I'm using my Mac to develop and ASP.NET Core application with SQLite as the database (when learning about SQLite and EF Core, I read through this tutorial: https://learn.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite). Migrations and updating the database schema are working, but it seems as though the ASP.NET application is holding onto the database in memory.
Two reasons I'm assuming this:
Does anyone know how I can have my application actually write out the data to the SQLite file, and prevent it from storing it in memory?
Thanks again!
DbContext file:
public class EssBomContext : DbContext
{
public DbSet<Part> Parts { get; set; }
// Other DbSets removed for brevety
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Data Source=sqlite.db");
}
}
Upvotes: 0
Views: 1606
Reputation: 737
"How can I have the Web project use the db in the Data.EF project?"
Possibly optionsBuilder.UseSqlite("Data Source=\Data.EF\sqlite.db");
Upvotes: 0