This commit is contained in:
@@ -14,7 +14,7 @@ using System.Linq;
|
||||
|
||||
namespace Dilon.EntityFramework.Core
|
||||
{
|
||||
[AppDbContext("DefaultConnection", DbProvider.Sqlite)]
|
||||
[AppDbContext("DefaultConnection", DbProvider.MySql)]
|
||||
public class DefaultDbContext : AppDbContext<DefaultDbContext>, IMultiTenantOnDatabase, IModelBuilderFilter
|
||||
{
|
||||
public DefaultDbContext(DbContextOptions<DefaultDbContext> options) : base(options)
|
||||
@@ -25,7 +25,15 @@ namespace Dilon.EntityFramework.Core
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSqlite(GetDatabaseConnectionString());
|
||||
optionsBuilder.UseMySql(
|
||||
GetDatabaseConnectionString(),
|
||||
ServerVersion.FromString("5.5.53-mysql"),
|
||||
p => p.EnableRetryOnFailure(
|
||||
maxRetryCount: 5,
|
||||
maxRetryDelay: TimeSpan.FromSeconds(30),
|
||||
errorNumbersToAdd: new int[] { 2 }
|
||||
)
|
||||
);
|
||||
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user