using Microsoft.Extensions.DependencyInjection; using AipGateway.API.Domain.IRepositories.IGenericRepositories; using AipGateway.API.Domain.Models; using Microsoft.Extensions.Configuration; using AipGateway.API.Infrastructure.DataAccess; using AipGateway.API.Infrastructure.Persistence; using Microsoft.EntityFrameworkCore; namespace AipGateway.API.Infrastructure { public static class Dependencyinjection { public static IServiceCollection AddInfrastructureLayerServices(this IServiceCollection services, IConfiguration configuration) { services.Add(new ServiceDescriptor(typeof(ConnectionInfo), new ConnectionInfo(configuration.GetConnectionString("DefaultConnection")))); services.AddDbContext(options => { //options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking) //,ServiceLifetime.Transient } ); services.AddScoped(); //services.AddSingleton(); return services; } } }