-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEFxceptionsIdentityContext.cs.cs
More file actions
69 lines (59 loc) · 2.75 KB
/
EFxceptionsIdentityContext.cs.cs
File metadata and controls
69 lines (59 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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<TUser, TRole, TKey>
: IdentityDbContextBase<TUser, TRole, TKey, IdentityUserClaim<TKey>, IdentityUserRole<TKey>,
IdentityUserLogin<TKey>, IdentityRoleClaim<TKey>, IdentityUserToken<TKey>, NpgsqlException, string>
where TUser : IdentityUser<TKey>
where TRole : IdentityRole<TKey>
where TKey : IEquatable<TKey>
{
public EFxceptionsIdentityContext(DbContextOptions options) : base(options)
{ }
protected EFxceptionsIdentityContext() : base()
{ }
protected override IDbErrorBroker<NpgsqlException, string> CreateErrorBroker() =>
new PostgreSqlErrorBroker();
protected override IEFxceptionService CreateEFxceptionService(
IDbErrorBroker<NpgsqlException, string> errorBroker)
{
return new PostgreSqlEFxceptionService(errorBroker);
}
}
public abstract class EFxceptionsIdentityContext<
TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken>
: IdentityDbContextBase<TUser, TRole, TKey,
TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken, NpgsqlException, string>
where TUser : IdentityUser<TKey>
where TRole : IdentityRole<TKey>
where TKey : IEquatable<TKey>
where TUserClaim : IdentityUserClaim<TKey>
where TUserRole : IdentityUserRole<TKey>
where TUserLogin : IdentityUserLogin<TKey>
where TRoleClaim : IdentityRoleClaim<TKey>
where TUserToken : IdentityUserToken<TKey>
{
public EFxceptionsIdentityContext(DbContextOptions options) : base(options)
{ }
protected EFxceptionsIdentityContext() : base()
{ }
protected override IDbErrorBroker<NpgsqlException, string> CreateErrorBroker() =>
new PostgreSqlErrorBroker();
protected override IEFxceptionService CreateEFxceptionService(
IDbErrorBroker<NpgsqlException, string> errorBroker)
{
return new PostgreSqlEFxceptionService(errorBroker);
}
}
}