public RenewAccountSessionCommandHandler(IMediator mediator, AuthDataContext repo, ITokenService token, AuthenticateConfig authConfig, IHttpContextService httpContextService)
 {
     _token              = token ?? throw new ArgumentNullException(nameof(token));
     _authConfig         = authConfig ?? throw new ArgumentNullException(nameof(authConfig));
     _httpContextService = httpContextService ?? throw new ArgumentNullException(nameof(httpContextService));
     _repo     = repo ?? throw new ArgumentNullException(nameof(repo));
     _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
 }
Ejemplo n.º 2
0
 public AuthenticateAccountCommandHandler(IMediator mediator, AuthDataContext repo, IHashService hash, ITokenService token, AuthenticateConfig authConfig)
 {
     _token      = token ?? throw new ArgumentNullException(nameof(token));
     _authConfig = authConfig ?? throw new ArgumentNullException(nameof(authConfig));
     _repo       = repo ?? throw new ArgumentNullException(nameof(repo));
     _hash       = hash ?? throw new ArgumentNullException(nameof(hash));
     _mediator   = mediator ?? throw new ArgumentNullException(nameof(mediator));
 }
Ejemplo n.º 3
0
        public static AuthDataContext Create()
        {
            var options = new DbContextOptionsBuilder <AuthDataContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var context = new AuthDataContext(options);

            context.Database.EnsureCreated();
            return(context);
        }
Ejemplo n.º 4
0
 public static void Destroy(AuthDataContext context)
 {
     context.Database.EnsureDeleted();
     context.Dispose();
 }
Ejemplo n.º 5
0
 public UserRepository(AuthDataContext context)
 {
     _context = context;
 }
Ejemplo n.º 6
0
 public AccountRepository(AuthDataContext context) : base(context)
 {
 }
Ejemplo n.º 7
0
 public BaseAuthRepository(AuthDataContext context) : base(context)
 {
 }
Ejemplo n.º 8
0
 public QueryTestFixture()
 {
     Context = TestDbContextFactory.Create();
 }
Ejemplo n.º 9
0
 public CreateAccountCommandHandler(IMediator mediator, AuthDataContext repo, IHashService hash)
 {
     _repo     = repo ?? throw new ArgumentNullException(nameof(repo));
     _hash     = hash ?? throw new ArgumentNullException(nameof(hash));
     _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
 }
Ejemplo n.º 10
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AuthDataContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseAuthentication()
            .UseCors()
            .UseMvc(routes => routes.MapRoute(
                        name: "default",
                        template: "api/{controller=Auth}/{action=Index}/{id?}"
                        ))
            .UseHealthChecks("/_hc");

            dbContext.Database.EnsureCreated();
        }
Ejemplo n.º 11
0
 public DbConnectionHealthCheck(AuthDataContext repo)
 {
     _repo = repo;
 }