18 lines
457 B
C#
18 lines
457 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging.Console;
|
|
|
|
namespace BITKit;
|
|
|
|
public class MySQLContext<T>:DbContext where T:class
|
|
{
|
|
protected readonly string _connectSql;
|
|
protected DbSet<T> context { get; private set; }
|
|
public MySQLContext(string connectSql) : base()
|
|
{
|
|
_connectSql = connectSql;
|
|
}
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
optionsBuilder.UseMySQL("_connectSql");
|
|
}
|
|
} |