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(); }
public Repository(DatabaseManagerContext dbContext) { DbContext = dbContext; }
#pragma warning disable 1591 public AuthService(DatabaseManagerContext dbContext) #pragma warning restore 1591 { _dbContext = dbContext; }
public UserRepository(DatabaseManagerContext dbContext) : base(dbContext) { _dbContext = dbContext; }