Browse Source

Refactor AbpEfCoreServiceCollectionExtensions

pull/81/head
Halil İbrahim Kalkan 10 years ago
parent
commit
4960d3a247
  1. 4
      src/Volo.Abp.EntityFrameworkCore/Microsoft/Extensions/DependencyInjection/AbpEfCoreServiceCollectionExtensions.cs

4
src/Volo.Abp.EntityFrameworkCore/Microsoft/Extensions/DependencyInjection/AbpEfCoreServiceCollectionExtensions.cs

@ -10,9 +10,7 @@ namespace Microsoft.Extensions.DependencyInjection
public static IServiceCollection AddAbpDbContext<TDbContext>(this IServiceCollection services, Action<IAbpDbContextRegistrationOptionsBuilder> optionsBuilder = null) //Created overload instead of default parameter public static IServiceCollection AddAbpDbContext<TDbContext>(this IServiceCollection services, Action<IAbpDbContextRegistrationOptionsBuilder> optionsBuilder = null) //Created overload instead of default parameter
where TDbContext : AbpDbContext<TDbContext> where TDbContext : AbpDbContext<TDbContext>
{ {
services //TODO: This code is copied from EntityFrameworkServiceCollectionExtensions, we should think on that later services.AddMemoryCache();
.AddMemoryCache()
.AddLogging();
services.TryAddTransient<TDbContext>(); services.TryAddTransient<TDbContext>();
services.TryAddTransient(DbContextOptionsFactory.Create<TDbContext>); services.TryAddTransient(DbContextOptionsFactory.Create<TDbContext>);

Loading…
Cancel
Save