diff --git a/STX.EFxceptions.Identity.PostgreSQL/EFxceptionsIdentityContext.cs.cs b/STX.EFxceptions.Identity.PostgreSQL/EFxceptionsIdentityContext.cs.cs new file mode 100644 index 0000000..171bf45 --- /dev/null +++ b/STX.EFxceptions.Identity.PostgreSQL/EFxceptionsIdentityContext.cs.cs @@ -0,0 +1,69 @@ +// ---------------------------------------------------------------------------------- +// Copyright(c) The Standard Organization: A coalition of the Good-Hearted Engineers +// ---------------------------------------------------------------------------------- + + +using System; +using Microsoft.AspNetCore.Identity; +using Microsoft.EntityFrameworkCore; +using Npgsql; +using STX.EFxceptions.Abstractions.Brokers.DbErrorBroker; +using STX.EFxceptions.Abstractions.Services.EFxceptions; +using STX.EFxceptions.Identity.Core; +using STX.EFxceptions.PostgreSQL.Base.Brokers.DbErrorBroker; +using STX.EFxceptions.PostgreSQL.Base.Services.Foundations; + +namespace STX.EFxceptions.Identity.PostgreSQL +{ + public abstract class EFxceptionsIdentityContext + : IdentityDbContextBase, IdentityUserRole, + IdentityUserLogin, IdentityRoleClaim, IdentityUserToken, NpgsqlException, string> + where TUser : IdentityUser + where TRole : IdentityRole + where TKey : IEquatable + { + public EFxceptionsIdentityContext(DbContextOptions options) : base(options) + { } + + protected EFxceptionsIdentityContext() : base() + { } + + protected override IDbErrorBroker CreateErrorBroker() => + new PostgreSqlErrorBroker(); + + protected override IEFxceptionService CreateEFxceptionService( + IDbErrorBroker errorBroker) + { + return new PostgreSqlEFxceptionService(errorBroker); + } + } + + public abstract class EFxceptionsIdentityContext< + TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken> + : IdentityDbContextBase + where TUser : IdentityUser + where TRole : IdentityRole + where TKey : IEquatable + where TUserClaim : IdentityUserClaim + where TUserRole : IdentityUserRole + where TUserLogin : IdentityUserLogin + where TRoleClaim : IdentityRoleClaim + where TUserToken : IdentityUserToken + { + public EFxceptionsIdentityContext(DbContextOptions options) : base(options) + { } + + protected EFxceptionsIdentityContext() : base() + { } + + protected override IDbErrorBroker CreateErrorBroker() => + new PostgreSqlErrorBroker(); + + protected override IEFxceptionService CreateEFxceptionService( + IDbErrorBroker errorBroker) + { + return new PostgreSqlEFxceptionService(errorBroker); + } + } +} \ No newline at end of file diff --git a/STX.EFxceptions.Identity.PostgreSQL/STX.EFxceptions.Identity.PostgreSQL.csproj b/STX.EFxceptions.Identity.PostgreSQL/STX.EFxceptions.Identity.PostgreSQL.csproj index e2c1565..c56c655 100644 --- a/STX.EFxceptions.Identity.PostgreSQL/STX.EFxceptions.Identity.PostgreSQL.csproj +++ b/STX.EFxceptions.Identity.PostgreSQL/STX.EFxceptions.Identity.PostgreSQL.csproj @@ -28,6 +28,12 @@ True + + + + + + true