diff --git a/EntityFrameworkCore.Console/Program.cs b/EntityFrameworkCore.Console/Program.cs index 7524365..bb07364 100644 --- a/EntityFrameworkCore.Console/Program.cs +++ b/EntityFrameworkCore.Console/Program.cs @@ -3,7 +3,13 @@ using EntityFrameworkCore.Domain; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; -using var context = new DeadBallZoneLeagueDbContext(); + +var folder = Environment.SpecialFolder.LocalApplicationData; +var path = Environment.GetFolderPath(folder); +var dbPath = Path.Combine(path, "DeadBallZoneLeague_EFCore.db"); +var optionsBuilder = new DbContextOptionsBuilder(); +optionsBuilder.UseSqlite($"Data Source={dbPath}"); +using var context = new DeadBallZoneLeagueDbContext(optionsBuilder.Options); // context.Database.Migrate(); // Can be used to automatically migrate on run. context.Database.EnsureCreated();