46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using BMA.EHR.Application.Common.Interfaces;
|
|
using BMA.EHR.Infrastructure.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace BMA.EHR.Infrastructure
|
|
{
|
|
public static class InfrastructureServiceRegistration
|
|
{
|
|
public static IServiceCollection AddPersistence(this IServiceCollection services,
|
|
IConfiguration configuration)
|
|
{
|
|
services.AddDbContext<ApplicationDBContext>(options =>
|
|
options.UseOracle(configuration.GetConnectionString("DefaultConnection"),
|
|
b => b.MigrationsAssembly(typeof(ApplicationDBContext).Assembly.FullName)), ServiceLifetime.Transient);
|
|
|
|
services.AddScoped<IApplicationDBContext>(provider => provider.GetService<ApplicationDBContext>());
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddEmailSender(this IServiceCollection services,
|
|
IConfiguration configuration)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddS3Storage(this IServiceCollection services,
|
|
IConfiguration configuration)
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
return services;
|
|
}
|
|
|
|
}
|
|
}
|