Class AppDbContext
- Namespace
- Integrations.Infrastructure.Persistence
- Assembly
- Integrations.Infrastructure.dll
EF Core context for the integrations schema, including the MassTransit outbox tables.
public sealed class AppDbContext : DbContext, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IDisposable, IAsyncDisposable, IAppDbContext
- Inheritance
-
AppDbContext
- Implements
- Inherited Members
Constructors
AppDbContext(DbContextOptions<AppDbContext>)
EF Core context for the integrations schema, including the MassTransit outbox tables.
public AppDbContext(DbContextOptions<AppDbContext> options)
Parameters
optionsDbContextOptions<AppDbContext>
Fields
Schema
Postgres schema for every table.
public const string Schema = "integrations"
Field Value
Properties
AdminAudit
Append-only log of money and configuration changes (who, what, when).
public DbSet<AdminAuditEntry> AdminAudit { get; }
Property Value
CertificateExpiryNotices
Expiry notices already sent (so each is sent once).
public DbSet<CertificateExpiryNotice> CertificateExpiryNotices { get; }
Property Value
CertificateRequests
Certificate invites and resale-certificate requests.
public DbSet<CertificateRequest> CertificateRequests { get; }
Property Value
DeferredMessages
Consumed messages waiting for delayed redelivery (infrastructure only; not part of IAppDbContext).
public DbSet<DeferredMessage> DeferredMessages { get; }
Property Value
Entities
Configured legal entities (PVC, DXT-CA, ...).
public DbSet<LegalEntity> Entities { get; }
Property Value
ExchangeRates
Daily exchange rates (immutable once stored).
public DbSet<ExchangeRateObservation> ExchangeRates { get; }
Property Value
JobRuns
Last run of each scheduled job, shared by every replica (infrastructure only).
public DbSet<JobRun> JobRuns { get; }
Property Value
Parties
Customers and vendors and their sync state with the provider.
public DbSet<PartySyncRecord> Parties { get; }
Property Value
ProviderCallAudits
One row per external provider call.
public DbSet<ProviderCallAudit> ProviderCallAudits { get; }
Property Value
RateLocks
Exchange-rate locks.
public DbSet<RateLock> RateLocks { get; }
Property Value
ReconciliationIssues
Differences found by the nightly reconciliation.
public DbSet<ReconciliationIssue> ReconciliationIssues { get; }
Property Value
TaxCodeMappings
Work type / category to tax code mappings.
public DbSet<TaxCodeMapping> TaxCodeMappings { get; }
Property Value
TaxDocuments
Tax documents with their lines and jurisdiction details.
public DbSet<TaxDocument> TaxDocuments { get; }
Property Value
Methods
ConfigureConventions(ModelConfigurationBuilder)
Default precision for money and rates.
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
Parameters
configurationBuilderModelConfigurationBuilder
IsUniqueViolation(DbUpdateException)
True when the save failed on a unique index (a concurrent insert won the race).
public bool IsUniqueViolation(DbUpdateException exception)
Parameters
exceptionDbUpdateException
Returns
OnModelCreating(ModelBuilder)
Applies the entity configurations in this assembly and the outbox tables.
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
modelBuilderModelBuilder