refactor(DocSignedNotificationTests): add again EmailOut DbRepository using Fake.EGDbContext2Prod
- create base EGDbContextBase to be able to add custom DbContextOptions
This commit is contained in:
@@ -14,8 +14,15 @@ using EnvelopeGenerator.Application.Common.Configurations;
|
||||
|
||||
namespace EnvelopeGenerator.Infrastructure;
|
||||
|
||||
public class EGDbContext : EGDbContextBase
|
||||
{
|
||||
public EGDbContext(DbContextOptions<EGDbContext> options, IOptions<DbTriggerParams> triggerParamOptions, ILogger<EGDbContext>? logger = null) : base(options, triggerParamOptions, logger)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Adding EmailOut instead of EmailOut.Abst is not correct for the arch. Re-design EmailPut consedering this. IMailDbContext shoud move to Abstraction layer (hint: in this case using DBSet in abst. will be problem because entity framework will have to be added.
|
||||
public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
|
||||
public abstract class EGDbContextBase : DbContext, IUserManagerDbContext, IMailDbContext
|
||||
{
|
||||
public DbSet<Config> Configs { get; set; }
|
||||
|
||||
@@ -57,11 +64,11 @@ public class EGDbContext : DbContext, IUserManagerDbContext, IMailDbContext
|
||||
|
||||
private readonly DbTriggerParams _triggers;
|
||||
|
||||
private readonly ILogger<EGDbContext>? _logger;
|
||||
private readonly ILogger? _logger;
|
||||
|
||||
public bool IsMigration { get; set; } = false;
|
||||
|
||||
public EGDbContext(DbContextOptions<EGDbContext> options, IOptions<DbTriggerParams> triggerParamOptions, ILogger<EGDbContext>? logger = null) : base(options)
|
||||
public EGDbContextBase(DbContextOptions options, IOptions<DbTriggerParams> triggerParamOptions, ILogger? logger = null) : base(options)
|
||||
{
|
||||
_triggers = triggerParamOptions.Value;
|
||||
_logger = logger;
|
||||
|
||||
Reference in New Issue
Block a user