This repository has been archived on 2023-02-13. You can view files and clone it, but cannot push or open issues or pull requests.
gswi-server/gswi.Data/DesignTimeContextFactory.cs

23 lines
730 B
C#
Raw Permalink Normal View History

2022-02-20 19:04:11 +01:00
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Text;
namespace gswi.Data
{
public class DesignTimeContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
{
public DatabaseContext CreateDbContext(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
optionsBuilder.UseMySql(
"server=localhost;user=sh_login_counter;password=mZaKBHY1lhzQoCAv;database=sh_login_counter",
new MySqlServerVersion(new Version(10, 3, 32))
);
return new DatabaseContext(optionsBuilder.Options);
}
}
}