Kaynağa Gözat

fix issue #16.

master
yangxiaodong 7 yıl önce
ebeveyn
işleme
9ef8d4c483
2 değiştirilmiş dosya ile 6 ekleme ve 8 silme
  1. +3
    -4
      src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
  2. +3
    -4
      src/DotNetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs

+ 3
- 4
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs Dosyayı Görüntüle

@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
var sqlServerOptions = new MySqlOptions();
_configure(sqlServerOptions);

var provider = TempBuildService(services);
var dbContextObj = provider.GetService(sqlServerOptions.DbContextType);
if (dbContextObj != null)
if (sqlServerOptions.DbContextType != null)
{
var provider = TempBuildService(services);
var dbContextObj = provider.GetService(sqlServerOptions.DbContextType);
var dbContext = (DbContext)dbContextObj;
sqlServerOptions.ConnectionString = dbContext.Database.GetDbConnection().ConnectionString;
}
services.Configure(_configure);
services.AddSingleton(sqlServerOptions);
}



+ 3
- 4
src/DotNetCore.CAP.SqlServer/CAP.SqlServerCapOptionsExtension.cs Dosyayı Görüntüle

@@ -26,14 +26,13 @@ namespace DotNetCore.CAP
var sqlServerOptions = new SqlServerOptions();
_configure(sqlServerOptions);

var provider = TempBuildService(services);
var dbContextObj = provider.GetService(sqlServerOptions.DbContextType);
if (dbContextObj != null)
if (sqlServerOptions.DbContextType != null)
{
var provider = TempBuildService(services);
var dbContextObj = provider.GetService(sqlServerOptions.DbContextType);
var dbContext = (DbContext)dbContextObj;
sqlServerOptions.ConnectionString = dbContext.Database.GetDbConnection().ConnectionString;
}
services.Configure(_configure);
services.AddSingleton(sqlServerOptions);
}



Yükleniyor…
İptal
Kaydet