Compare commits

..

No commits in common. "b5cd42b6fa00f7d8f9b6103a922a494b4f7417e1" and "22b494a2624053e14b71d90ef07d2ea935091652" have entirely different histories.

23 changed files with 66 additions and 605 deletions

View File

@ -36,7 +36,6 @@ public class MappingProfile : Profile
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
CreateMap<ElementAnnotation, AnnotationDto>();
CreateMap<ThirdPartyModule, ThirdPartyModuleDto>();
// DTO to Entity mappings
CreateMap<ConfigDto, Config>();

View File

@ -1,57 +0,0 @@
namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
///
/// </summary>
public record ThirdPartyModuleDto
{
/// <summary>
///
/// </summary>
public int Id { get; init; }
/// <summary>
///
/// </summary>
public bool Active { get; init; }
/// <summary>
///
/// </summary>
public string Name { get; init; } = default!;
/// <summary>
///
/// </summary>
public string? Description { get; init; }
/// <summary>
///
/// </summary>
public string License { get; init; } = default!;
/// <summary>
///
/// </summary>
public string Version { get; init; } = default!;
/// <summary>
///
/// </summary>
public string? AddedWho { get; init; }
/// <summary>
///
/// </summary>
public DateTime? AddedWhen { get; init; }
/// <summary>
///
/// </summary>
public string? ChangedWho { get; init; }
/// <summary>
///
/// </summary>
public DateTime? ChangedWhen { get; init; }
}

View File

@ -1,92 +0,0 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using EnvelopeGenerator.Application.Common.Dto;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Application.ThirdPartyModules.Queries;
/// <summary>
///
/// </summary>
public record ReadThirdPartyModuleQuery : IRequest<IEnumerable<ThirdPartyModuleDto>>
{
/// <summary>
///
/// </summary>
public string? Name { get; init; }
/// <summary>
///
/// </summary>
public bool? Active { get; init; }
}
/// <summary>
///
/// </summary>
public record ReadThirdPartyModuleQueryHandler : IRequestHandler<ReadThirdPartyModuleQuery, IEnumerable<ThirdPartyModuleDto>>
{
private readonly IMapper _mapper;
private readonly IRepository<ThirdPartyModule> _repo;
/// <summary>
///
/// </summary>
/// <param name="mapper"></param>
/// <param name="repo"></param>
public ReadThirdPartyModuleQueryHandler(IMapper mapper, IRepository<ThirdPartyModule> repo)
{
_mapper = mapper;
_repo = repo;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="cancel"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<IEnumerable<ThirdPartyModuleDto>> Handle(ReadThirdPartyModuleQuery request, CancellationToken cancel)
{
var query = _repo.Query;
if(request.Name is string name)
query = query.Where(m => m.Name == name);
if (request.Active is bool active)
query = query.Where(m => m.Active == active);
var modules = await query.ToListAsync(cancel);
return _mapper.Map<IEnumerable<ThirdPartyModuleDto>>(modules);
}
}
/// <summary>
///
/// </summary>
public static class ReadThirdPartyModuleQueryExtensions
{
/// <summary>
///
/// </summary>
/// <param name="mediator"></param>
/// <param name="name"></param>
/// <param name="active"></param>
/// <param name="cancel"></param>
/// <returns></returns>
public static async Task<string?> ReadThirdPartyModuleLicenseAsync(this IMediator mediator, string name, bool active = true, CancellationToken cancel = default)
{
var modules = await mediator.Send(new ReadThirdPartyModuleQuery()
{
Name = name,
Active = active,
}, cancel);
return modules.FirstOrDefault()?.License;
}
}

View File

@ -11,11 +11,10 @@ namespace EnvelopeGenerator.DependencyInjection;
public static class DependencyInjection
{
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, Action<EGConfiguration> options)
public static IServiceCollection AddEnvelopeGenerator(this IServiceCollection services, IConfiguration config, Action<EGConfiguration> options, Action<SqlServerCacheOptions> distributedCacheOptions)
{
var egConfig = new EGConfiguration();
options.Invoke(egConfig);
egConfig.EnsureAllServicesConfigured();
egConfig.RegisterAll(services);
// Add envelope generator services
@ -30,68 +29,41 @@ public static class DependencyInjection
public record EGConfiguration
{
internal readonly Queue<Action<IServiceCollection>> _serviceRegs = new();
internal readonly Queue<Action<IServiceCollection>> ServiceRegs = new();
internal void RegisterAll(IServiceCollection services)
{
while (_serviceRegs.Count > 0)
_serviceRegs.Dequeue().Invoke(services);
while (ServiceRegs.Count > 0)
ServiceRegs.Dequeue().Invoke(services);
}
// TODO: update to use attributes and reflections instead of _addingStatus-dictionary
private readonly Dictionary<string, bool> _addingStatus = new ()
public EGConfiguration AddLocalization()
{
{ nameof(AddLocalization), false },
{ nameof(AddDistributedSqlServerCache), false },
{ nameof(AddInfrastructure), false },
{ nameof(AddServices), false },
};
public EGConfiguration AddLocalization(Action<IServiceCollection>? customLocalizationOptions = null)
{
_serviceRegs.Enqueue(customLocalizationOptions ?? (s => s.AddLocalization()));
_addingStatus[nameof(AddLocalization)] = true;
ServiceRegs.Enqueue(s => s.AddLocalization());
return this;
}
public EGConfiguration AddDistributedSqlServerCache(Action<SqlServerCacheOptions> setupAction)
{
_serviceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction));
_addingStatus[nameof(AddDistributedSqlServerCache)] = true;
ServiceRegs.Enqueue(s => s.AddDistributedSqlServerCache(setupAction));
return this;
}
public EGConfiguration AddInfrastructure(Action<EGInfrastructureConfiguration> options)
{
#pragma warning disable CS0618
_serviceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
ServiceRegs.Enqueue(s => s.AddEGInfrastructureServices(options));
#pragma warning restore CS0618
_addingStatus[nameof(AddInfrastructure)] = true;
return this;
}
public EGConfiguration AddServices(IConfiguration config)
public IConfiguration Configuration
{
#pragma warning disable CS0618
_serviceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(config));
#pragma warning restore CS0618
_addingStatus[nameof(AddServices)] = true;
return this;
}
internal void EnsureAllServicesConfigured()
{
var missingServices = _addingStatus
.Where(kv => !kv.Value)
.Select(kv => kv.Key)
.ToList();
if (missingServices.Count > 0)
set
{
var missingList = string.Join(", ", missingServices);
throw new InvalidOperationException(
$"Service configuration incomplete. The following required service methods were not called: {missingList}. " +
"Please ensure all necessary configuration methods are invoked before building the application.");
#pragma warning disable CS0618
ServiceRegs.Enqueue(s => s.AddEnvelopeGeneratorServices(value));
#pragma warning restore CS0618
}
}
}

View File

@ -1,73 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif
namespace EnvelopeGenerator.Domain.Entities
{
[Table("TBDD_3RD_PARTY_MODULES")]
public class ThirdPartyModule
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column("GUID")]
public int Id { get; set; }
[Required]
[Column("ACTIVE")]
public bool Active { get; set; }
[Required]
[StringLength(50)]
[Column("NAME")]
public string Name { get; set; }
[StringLength(500)]
[Column("DESCRIPTION")]
public string
#if nullable
?
#endif
Description { get; set; }
[Required]
[Column("LICENSE", TypeName = "varchar(max)")]
public string License { get; set; }
[Required]
[StringLength(20)]
[Column("VERSION")]
public string Version { get; set; }
[StringLength(50)]
[Column("ADDED_WHO")]
public string
#if nullable
?
#endif
AddedWho { get; set; }
[Column("ADDED_WHEN")]
public DateTime
#if nullable
?
#endif
AddedWhen { get; set; }
[StringLength(50)]
[Column("CHANGED_WHO")]
public string
#if nullable
?
#endif
ChangedWho { get; set; }
[Column("CHANGED_WHEN")]
public DateTime
#if nullable
?
#endif
ChangedWhen { get; set; }
}
}

View File

@ -18,16 +18,6 @@
<ItemGroup>
<ProjectReference Include="..\EnvelopeGenerator.Application\EnvelopeGenerator.Application.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.DependencyInjection\EnvelopeGenerator.DependencyInjection.csproj" />
<ProjectReference Include="..\EnvelopeGenerator.Infrastructure\EnvelopeGenerator.Infrastructure.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.Database.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.Logging.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@ -1,9 +0,0 @@
namespace EnvelopeGenerator.Finalizer.Models;
public class GdPictureOptions
{
/// <summary>
///
/// </summary>
public string License { get; set; } = null!;
}

View File

@ -1,19 +0,0 @@
namespace EnvelopeGenerator.Finalizer.Models;
public class WorkerOptions
{
private double _intervalInMin = 1.0;
public double IntervalInMin {
get => _intervalInMin;
set
{
_intervalInMin = value;
IntervalInMillisecond = Min2Millisecond(value);
}
}
public int IntervalInMillisecond { get; private set; } = Min2Millisecond(1.0);
private static int Min2Millisecond(double min) => Convert.ToInt32(Math.Round(min * 60 * 1000));
}

View File

@ -1,24 +1,18 @@
using EnvelopeGenerator.Application.ThirdPartyModules.Queries;
using EnvelopeGenerator.DependencyInjection;
using EnvelopeGenerator.Application;
using EnvelopeGenerator.Finalizer;
using EnvelopeGenerator.Finalizer.Models;
using EnvelopeGenerator.Infrastructure;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Serilog;
// Load Serilog from appsettings.json
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(new ConfigurationBuilder()
.AddJsonFile("appsettings.Logging.json", optional: false, reloadOnChange: true)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.Build())
.CreateLogger();
try
{
Log.Information("Application is starting...");
var builder = Host.CreateApplicationBuilder(args);
// add serilog
@ -26,62 +20,35 @@ try
builder.Logging.AddSerilog();
var config = builder.Configuration;
Directory
.GetFiles(builder.Environment.ContentRootPath, "appsettings.*.json", SearchOption.TopDirectoryOnly)
.Where(file => Path.GetFileName(file) != $"appsettings.Development.json")
.Where(file => Path.GetFileName(file) != $"appsettings.migration.json")
.ToList()
.ForEach(file => config.AddJsonFile(file, true, true));
#region Worker
builder.Services.AddHostedService<Worker>();
builder.Services.Configure<WorkerOptions>(config.GetSection("Worker"));
#endregion
#region Add DB Context, EG Inf. and Services
var cnnStrName = "Default";
var connStr = config.GetConnectionString(cnnStrName)
?? throw new InvalidOperationException($"Connection string '{cnnStrName}' is missing in the application configuration.");
builder.Services.AddEnvelopeGenerator(egOptions => egOptions
.AddLocalization()
.AddDistributedSqlServerCache(options =>
{
options.ConnectionString = connStr;
options.SchemaName = "dbo";
options.TableName = "TBDD_CACHE";
})
.AddInfrastructure(opt =>
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services.AddEGInfrastructureServices(
opt =>
{
opt.AddDbTriggerParams(config);
opt.AddDbContext((provider, options) =>
{
var logger = provider.GetRequiredService<ILogger<EGDbContext>>();
options.UseSqlServer(connStr)
.LogTo(log => logger.LogInformation("{log}", log), LogLevel.Trace)
.LogTo(log => logger.LogInformation("{log}", log), Microsoft.Extensions.Logging.LogLevel.Trace)
.EnableSensitiveDataLogging()
.EnableDetailedErrors();
});
})
.AddServices(config)
);
});
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
builder.Services.AddEnvelopeGeneratorServices(config);
#pragma warning restore CS0618 // Type or member is obsolete
#endregion Add DB Context, EG Inf. and Services
builder.Services.AddOptions<GdPictureOptions>()
.Configure((GdPictureOptions opt, IServiceProvider sp) =>
{
var licenseKey = "GDPICTURE";
using var scope = sp.CreateScope();
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
opt.License = mediator.ReadThirdPartyModuleLicenseAsync(licenseKey).GetAwaiter().GetResult()
?? throw new InvalidOperationException($"License record not found for key: {licenseKey}");
});
var host = builder.Build();
var licence = host.Services.GetRequiredService<IOptions<GdPictureOptions>>().Value;
host.Run();
Log.Information("The worker was stopped.");

View File

@ -1,18 +1,12 @@
using EnvelopeGenerator.Finalizer.Models;
using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Finalizer
{
public class Worker : BackgroundService
{
private readonly ILogger<Worker> _logger;
private readonly WorkerOptions _options;
public Worker(ILogger<Worker> logger, IOptions<WorkerOptions> workerOptions)
public Worker(ILogger<Worker> logger)
{
_logger = logger;
_options = workerOptions.Value;
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
@ -23,7 +17,7 @@ namespace EnvelopeGenerator.Finalizer
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
}
await Task.Delay(_options.IntervalInMillisecond, stoppingToken);
await Task.Delay(1000, stoppingToken);
}
}
}

View File

@ -1,21 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"UseDbMigration": false,
"ConnectionStrings": {
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
},
"DbTriggerParams": {
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
"Receiver": [],
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
}
}

View File

@ -1,81 +0,0 @@
{
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
"MinimumLevel": {
"Default": "Verbose",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Verbose",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Debug",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Information",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Warning",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Error",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Fatal",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
}
}

View File

@ -1,14 +0,0 @@
{
"IgnoredLabels": {
"Label": [
"Date",
"Datum",
"ZIP",
"PLZ",
"Place",
"Ort",
"Position",
"Stellung"
]
}
}

View File

@ -1,21 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"UseDbMigration": false,
"ConnectionStrings": {
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
},
"DbTriggerParams": {
"Envelope": [ "TBSIG_ENVELOPE_AFT_INS" ],
"History": [ "TBSIG_ENVELOPE_HISTORY_AFT_INS" ],
"EmailOut": [ "TBEMLP_EMAIL_OUT_AFT_INS", "TBEMLP_EMAIL_OUT_AFT_UPD" ],
"EnvelopeReceiverReadOnly": [ "TBSIG_ENVELOPE_RECEIVER_READ_ONLY_UPD" ],
"Receiver": [],
"EmailTemplate": [ "TBSIG_EMAIL_TEMPLATE_AFT_UPD" ]
}
}

View File

@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@ -1,81 +0,0 @@
{
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
"MinimumLevel": {
"Default": "Verbose",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Verbose-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Verbose",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Debug-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Debug",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Info-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Information",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Warning-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Warning",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Error-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Error",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "E:/LogFiles/Digital Data/signFlow.Finalizer/log.Fatal-.txt",
"rollingInterval": "Day",
"restrictedToMinimumLevel": "Fatal",
"retainedFileCountLimit": 30,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
}
}

View File

@ -1,14 +0,0 @@
{
"IgnoredLabels": {
"Label": [
"Date",
"Datum",
"ZIP",
"PLZ",
"Place",
"Ort",
"Position",
"Stellung"
]
}
}

View File

@ -1,5 +0,0 @@
{
"Worker": {
"IntervalInMin": 0.01666666666
}
}

View File

@ -1,2 +1,40 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"Default": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
"DbMigrationTest": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM_DATA_MIGR_TEST;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
},
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "File",
"Args": {
"path": "Logs/log-.txt",
"rollingInterval": "Day",
"retainedFileCountLimit": 7,
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ]
}
}

View File

@ -105,7 +105,6 @@ try
});
builder.Services.AddOpenApi();
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
//AddEF Core dbcontext
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";

View File

@ -79,8 +79,6 @@ public abstract class EGDbContextBase : DbContext
public DbSet<ClientUser> ClientUsers { get; set; }
public DbSet<ThirdPartyModule> ThirdPartyModules { get; set; }
private readonly DbTriggerParams _triggers;
private readonly ILogger

View File

@ -86,7 +86,6 @@ try
builder.Services.AddSwaggerGen();
}
// TODO: Update to configure with EnvelopeGenerator.DependencyInjection
//AddEF Core dbcontext
var useDbMigration = Environment.GetEnvironmentVariable("MIGRATION_TEST_MODE") == true.ToString() || config.GetValue<bool>("UseDbMigration");
var cnnStrName = useDbMigration ? "DbMigrationTest" : "Default";

View File

@ -123,7 +123,7 @@ Global
{A9F9B431-BB9B-49B8-9E2C-0703634A653A} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
{6D56C01F-D6CB-4D8A-BD3D-4FD34326998C} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
{211619F5-AE25-4BA5-A552-BACAFE0632D3} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
{49E6A4C0-C2FC-4A34-9821-245AF050CA26} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
{49E6A4C0-C2FC-4A34-9821-245AF050CA26} = {9943209E-1744-4944-B1BA-4F87FC1A0EEB}
{B97DE7DD-3190-4A84-85E9-E57AD735BE61} = {E3C758DC-914D-4B7E-8457-0813F1FDB0CB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution