diff --git a/BMA.EHR.Application/ApplicationServicesRegistration.cs b/BMA.EHR.Application/ApplicationServicesRegistration.cs index 175de254..6636df32 100644 --- a/BMA.EHR.Application/ApplicationServicesRegistration.cs +++ b/BMA.EHR.Application/ApplicationServicesRegistration.cs @@ -35,6 +35,14 @@ namespace BMA.EHR.Application services.AddTransient(); services.AddTransient(); + //services.AddTransient(); + //services.AddTransient(); + + return services; + } + + public static IServiceCollection AddLeaveApplication(this IServiceCollection services) + { services.AddTransient(); services.AddTransient(); diff --git a/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs b/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs index ab32d1af..9be72977 100644 --- a/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs +++ b/BMA.EHR.Application/Common/Interfaces/IApplicationDBContext.cs @@ -1,5 +1,4 @@ -using BMA.EHR.Domain.Models.MetaData; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Application.Common.Interfaces { diff --git a/BMA.EHR.Application/Common/Interfaces/IApplicationDBExamContext.cs b/BMA.EHR.Application/Common/Interfaces/IApplicationDBExamContext.cs index ef2ca3a7..03e2c140 100644 --- a/BMA.EHR.Application/Common/Interfaces/IApplicationDBExamContext.cs +++ b/BMA.EHR.Application/Common/Interfaces/IApplicationDBExamContext.cs @@ -1,5 +1,4 @@ -using BMA.EHR.Domain.Models.MetaData; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; namespace BMA.EHR.Application.Common.Interfaces { diff --git a/BMA.EHR.Application/Repositories/Reports/CandidateReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/CandidateReportRepository.cs index af04c9c5..bf82f92e 100644 --- a/BMA.EHR.Application/Repositories/Reports/CandidateReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/CandidateReportRepository.cs @@ -1,18 +1,10 @@ -using System.Reflection.Metadata; -using System.Text; -using BMA.EHR.Application.Common.Interfaces; -using BMA.EHR.Application.Responses; +using BMA.EHR.Application.Common.Interfaces; using BMA.EHR.Domain.Extensions; -using BMA.EHR.Domain.Models.HR; -using BMA.EHR.Domain.Models.Organizations; -using BMA.EHR.Domain.Models.Retirement; using BMA.EHR.Domain.ModelsExam.Candidate; using BMA.EHR.Domain.Shared; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; +using System.Text; using static BMA.EHR.Domain.Extensions.DateTimeExtension; namespace BMA.EHR.Application.Repositories.Reports diff --git a/BMA.EHR.Application/Repositories/Reports/TransferReportRepository.cs b/BMA.EHR.Application/Repositories/Reports/TransferReportRepository.cs index 18d6fba9..4a38b21a 100644 --- a/BMA.EHR.Application/Repositories/Reports/TransferReportRepository.cs +++ b/BMA.EHR.Application/Repositories/Reports/TransferReportRepository.cs @@ -1,18 +1,9 @@ -using System; -using System.Reflection.Metadata; -using System.Text.RegularExpressions; -using BMA.EHR.Application.Common.Interfaces; -using BMA.EHR.Application.Responses; +using BMA.EHR.Application.Common.Interfaces; using BMA.EHR.Domain.Extensions; using BMA.EHR.Domain.Models.HR; -using BMA.EHR.Domain.Models.MetaData; -using BMA.EHR.Domain.Models.Organizations; using BMA.EHR.Domain.Models.Placement; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using Newtonsoft.Json; namespace BMA.EHR.Application.Repositories.Reports { diff --git a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs index 1d83e4db..66843bec 100644 --- a/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs +++ b/BMA.EHR.Infrastructure/InfrastructureServiceRegistration.cs @@ -12,7 +12,7 @@ namespace BMA.EHR.Infrastructure public static IServiceCollection AddLeavePersistence(this IServiceCollection services, IConfiguration configuration) { - services.AddScoped(provider => provider.GetService()); + // leave db context var connectionStringLeave = configuration.GetConnectionString("LeaveConnection"); @@ -65,7 +65,7 @@ namespace BMA.EHR.Infrastructure }), ServiceLifetime.Transient); - + services.AddScoped(provider => provider.GetService()); return services; } diff --git a/BMA.EHR.Leave.Service/Controllers/LeaveController.cs b/BMA.EHR.Leave.Service/Controllers/LeaveController.cs index 7fab8a83..6938c229 100644 --- a/BMA.EHR.Leave.Service/Controllers/LeaveController.cs +++ b/BMA.EHR.Leave.Service/Controllers/LeaveController.cs @@ -6,10 +6,8 @@ using BMA.EHR.Domain.Shared; using BMA.EHR.Infrastructure.Persistence; using BMA.EHR.Leave.Service.DTOs.CheckIn; using BMA.EHR.Leave.Service.DTOs.DutyTime; -using iTextSharp.text; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; using Swashbuckle.AspNetCore.Annotations; using System.ComponentModel.DataAnnotations; using System.Security.Claims; diff --git a/BMA.EHR.Leave.Service/Program.cs b/BMA.EHR.Leave.Service/Program.cs index a0fccfd1..96e6174d 100644 --- a/BMA.EHR.Leave.Service/Program.cs +++ b/BMA.EHR.Leave.Service/Program.cs @@ -79,6 +79,7 @@ var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddApplication(); + builder.Services.AddLeaveApplication(); builder.Services.AddPersistence(builder.Configuration); builder.Services.AddLeavePersistence(builder.Configuration);