コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryHandlerModule"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <param name="constants">The application constants.</param>
 /// <param name="principalProvider">The principal provider.</param>
 /// <param name="serializer">The JSON serializer.</param>
 public QueryHandlerModule(
     IAmiUnitOfWork context,
     IApplicationConstants constants,
     ICustomPrincipalProvider principalProvider,
     IDefaultJsonSerializer serializer)
 {
     Context           = context ?? throw new ArgumentNullException(nameof(context));
     Constants         = constants ?? throw new ArgumentNullException(nameof(constants));
     PrincipalProvider = principalProvider ?? throw new ArgumentNullException(nameof(principalProvider));
     Serializer        = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IdentityService"/> class.
 /// </summary>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="configuration">The API configuration.</param>
 /// <param name="idGenerator">The generator for unique identifiers.</param>
 /// <param name="principalProvider">The principal provider.</param>
 /// <param name="userManager">The user manager.</param>
 public IdentityService(
     ILoggerFactory loggerFactory,
     IApiConfiguration configuration,
     IIdGenerator idGenerator,
     ICustomPrincipalProvider principalProvider,
     UserManager <UserEntity> userManager)
 {
     logger                 = loggerFactory?.CreateLogger <IdentityService>() ?? throw new ArgumentNullException(nameof(loggerFactory));
     this.configuration     = configuration ?? throw new ArgumentNullException(nameof(configuration));
     this.principalProvider = principalProvider ?? throw new ArgumentNullException(nameof(principalProvider));
     this.userManager       = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandHandlerModule"/> class.
 /// </summary>
 /// <param name="auditService">The auditing service.</param>
 /// <param name="context">The context.</param>
 /// <param name="eventService">The events service.</param>
 /// <param name="gateway">The gateway service.</param>
 /// <param name="authService">The identity service.</param>
 /// <param name="principalProvider">The principal provider.</param>
 public CommandHandlerModule(
     IAuditService auditService,
     IAmiUnitOfWork context,
     IEventService eventService,
     IGatewayService gateway,
     IAuthService authService,
     ICustomPrincipalProvider principalProvider)
 {
     Audit             = auditService ?? throw new ArgumentNullException(nameof(auditService));
     Context           = context ?? throw new ArgumentNullException(nameof(context));
     Events            = eventService ?? throw new ArgumentNullException(nameof(eventService));
     Gateway           = gateway ?? throw new ArgumentNullException(nameof(gateway));
     AuthService       = authService ?? throw new ArgumentNullException(nameof(authService));
     PrincipalProvider = principalProvider ?? throw new ArgumentNullException(nameof(principalProvider));
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthService"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="principalProvider">The principal provider.</param>
 public AuthService(ILogger <AuthService> logger, ICustomPrincipalProvider principalProvider)
 {
     this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     this.principalProvider = principalProvider ?? throw new ArgumentNullException(nameof(principalProvider));
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RequiresRoleFilterAttribute"/> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="requirement">The requirement.</param>
 /// <param name="principalProvider">The principal provider.</param>
 public RequiresRoleFilterAttribute(ILogger <RequiresRoleAttribute> logger, RoleAuthorizationRequirement requirement, ICustomPrincipalProvider principalProvider)
 {
     this.logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     this.requirement       = requirement ?? throw new ArgumentNullException(nameof(requirement));
     this.principalProvider = principalProvider ?? throw new ArgumentNullException(nameof(principalProvider));
 }