1
This commit is contained in:
19
Assets/BITKit/EntityFramework/MySQLContext.cs
Normal file
19
Assets/BITKit/EntityFramework/MySQLContext.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
#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
|
Reference in New Issue
Block a user