From 66a74d6e8ca28d04a2114a33a794fd88c61544da Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Sun, 25 May 2025 14:37:25 -0400 Subject: [PATCH] EXPOSERS: Postgre Sql Db Context --- .../EFxceptionsContext.cs | 35 +++++++++++++++++++ .../STX.EFxceptions.PostgreSQL.csproj | 6 ++++ 2 files changed, 41 insertions(+) create mode 100644 STX.EFxceptions.PostgreSQL/EFxceptionsContext.cs diff --git a/STX.EFxceptions.PostgreSQL/EFxceptionsContext.cs b/STX.EFxceptions.PostgreSQL/EFxceptionsContext.cs new file mode 100644 index 0000000..9451df0 --- /dev/null +++ b/STX.EFxceptions.PostgreSQL/EFxceptionsContext.cs @@ -0,0 +1,35 @@ + +// ---------------------------------------------------------------------------------- +// Copyright(c) The Standard Organization: A coalition of the Good-Hearted Engineers +// ---------------------------------------------------------------------------------- + +using Microsoft.EntityFrameworkCore; +using Npgsql; +using STX.EFxceptions.Abstractions.Brokers.DbErrorBroker; +using STX.EFxceptions.Abstractions.Services.EFxceptions; +using STX.EFxceptions.Core; +using STX.EFxceptions.PostgreSQL.Base.Brokers.DbErrorBroker; +using STX.EFxceptions.PostgreSQL.Base.Services.Foundations; + +namespace STX.EFxceptions.PostgreSQL +{ + public abstract class EFxceptionsContext : DbContextBase + { + public EFxceptionsContext(DbContextOptions options) + : base(options) + { } + + protected EFxceptionsContext() + : base() + { } + + protected override IDbErrorBroker CreateErrorBroker() => + new PostgreSqlErrorBroker(); + + protected override IEFxceptionService CreateEFxceptionService( + IDbErrorBroker errorBroker) + { + return new PostgreSqlEFxceptionService(errorBroker); + } + } +} diff --git a/STX.EFxceptions.PostgreSQL/STX.EFxceptions.PostgreSQL.csproj b/STX.EFxceptions.PostgreSQL/STX.EFxceptions.PostgreSQL.csproj index e728094..e901db2 100644 --- a/STX.EFxceptions.PostgreSQL/STX.EFxceptions.PostgreSQL.csproj +++ b/STX.EFxceptions.PostgreSQL/STX.EFxceptions.PostgreSQL.csproj @@ -44,6 +44,12 @@ + + + + + +