public SessionStorageInMemory(DatabaseManagerContext dbContext)
 {
     foreach (var s in dbContext.ExpSessions.AsQueryable())
     {
         _storage.TryAdd(s.Token, 1);
     }
 }
        public RegistrationServiceTests()
        {
            var serviceProvider = new ServiceCollection()
                                  .AddEntityFrameworkNpgsql()
                                  .BuildServiceProvider();

            var builder = new DbContextOptionsBuilder <DatabaseManagerContext>();

            builder.UseNpgsql("Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=qwerty")
            .UseInternalServiceProvider(serviceProvider);

            _context = new DatabaseManagerContext(builder.Options);

            _context.Database.Migrate();
        }
Ejemplo n.º 3
0
 public Repository(DatabaseManagerContext dbContext)
 {
     DbContext = dbContext;
 }
Ejemplo n.º 4
0
#pragma warning disable 1591
        public AuthService(DatabaseManagerContext dbContext)
#pragma warning restore 1591
        {
            _dbContext = dbContext;
        }
Ejemplo n.º 5
0
 public UserRepository(DatabaseManagerContext dbContext) : base(dbContext)
 {
     _dbContext = dbContext;
 }