BITFALL/Assets/BITKit/EntityFramework/MySQLContext.cs

19 lines
442 B
C#

#if NET5_0_OR_GREATER
using Microsoft.EntityFrameworkCore;
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");
}
}
#endif