Skip to content
Snippets Groups Projects
Commit e6fda2e1 authored by HUONG THOMAS's avatar HUONG THOMAS
Browse files

change bdd path

parent 50471a7e
No related merge requests found
......@@ -8,7 +8,7 @@ namespace fichier1.Data
public class BddContext : DbContext
{
public BddContext()
: base(new DbContextOptionsBuilder<BddContext>().UseSqlite("Data Source=C:\\Users\\frees\\Documents\\Ecole temp\\t4-foc21\\fichier1\\fichier1\\bin\\Debug\\netcoreapp3.1\\Bdd.db").Options)
: base(new DbContextOptionsBuilder<BddContext>().UseSqlite("Data Source=C:\\Users\\frees\\Documents\\Ecole temp\\t4-foc21\\fichier1\\fichier1\\Bdd.db").Options)
{
}
......
......@@ -24,10 +24,11 @@ namespace fichier1
static void Main()
{
var path = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
var path1 = Path.Combine(path, "..", "..", "..");
// setup l'injection de dpendance
var serviceCollection = new ServiceCollection();
serviceCollection.AddDbContext<BddContext>(options =>
options.UseSqlite($"Data Source={path}\\Bdd.db"));
options.UseSqlite($"Data Source={path1}\\Bdd.db"));
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment