Add project files.
This commit is contained in:
parent
cc6b248537
commit
717b0f0a8e
31 changed files with 1296 additions and 0 deletions
23
BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs
Normal file
23
BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue