|
|
|
@ -17,9 +17,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
|
|
|
|
services.AddMemoryCache();
|
|
|
|
|
|
|
|
|
|
var options = new AbpDbContextRegistrationOptions(typeof(TDbContext), services);
|
|
|
|
|
optionsBuilder?.Invoke(options);
|
|
|
|
|
|
|
|
|
|
services.TryAddTransient(DbContextOptionsFactory.Create<TDbContext>);
|
|
|
|
|
|
|
|
|
|
var replaceDbContextAttribute = typeof(TDbContext).GetCustomAttribute<ReplaceDbContextAttribute>(true);
|
|
|
|
|
if (replaceDbContextAttribute != null)
|
|
|
|
@ -27,6 +24,10 @@ namespace Microsoft.Extensions.DependencyInjection
|
|
|
|
|
options.ReplacedDbContextTypes.AddRange(replaceDbContextAttribute.ReplacedDbContextTypes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
optionsBuilder?.Invoke(options);
|
|
|
|
|
|
|
|
|
|
services.TryAddTransient(DbContextOptionsFactory.Create<TDbContext>);
|
|
|
|
|
|
|
|
|
|
foreach (var dbContextType in options.ReplacedDbContextTypes)
|
|
|
|
|
{
|
|
|
|
|
services.Replace(
|
|
|
|
|