public SqlServerApiResourceStore(IIdentityDbContext identityDbContext, IEventService eventService, IUserResolverService userResolverService, ISerializationSettings serializationSettings) : base(identityDbContext, eventService, userResolverService, serializationSettings) { }
public async Task InitializeAsync() { MongoResource = new MongoResource(); await MongoResource.InitializeAsync(); Database = MongoResource.CreateDatabase(); IWebHostBuilder hostBuilder = new WebHostBuilder() .ConfigureAppConfiguration(builder => { builder.SetBasePath(Directory.GetCurrentDirectory()); builder.AddJsonFile("appsettings.test.json", optional: true); builder.AddInMemoryCollection(new Dictionary <string, string> { ["Identity:Database:ConnectionString"] = MongoResource.ConnectionString, ["Identity:Database:DatabaseName"] = Database.DatabaseNamespace.DatabaseName }); }) .ConfigureTestServices(services => { }) .UseStartup <Startup>(); var server = new TestServer(hostBuilder); Services = server.Services; IIdentityDbContext dbContext = server.Services.GetService <IIdentityDbContext>(); var seeder = new DataSeeder(dbContext); await seeder.SeedIntialDataAsync(default);
/// <summary> /// Creates a new instance of the <see cref="UserStore{TUser}"/> /// class using the provided <see cref="IIdentityDbContext"/>. /// </summary> /// <param name="dbContext">The <see cref="IIdentityDbContext"/> to use.</param> public UserStore(IIdentityDbContext dbContext) : this(new UsersTable <TUser>(dbContext), new RolesTable <IdentityRole>(dbContext), new UserRolesTable(dbContext), new UserClaimsTable(dbContext), new UserLoginsTable(dbContext)) { }
public SqlServerPersistedGrantStore(IIdentityDbContext identityDbContext, ILogger logger, IEventService eventService, IUserResolverService userResolverService, ISerializationSettings serializationSettings) : base(identityDbContext, eventService, userResolverService, serializationSettings) { _logger = logger; }
/// <summary> /// Creates a new instance of the <see cref="Table"/> /// class with the specified <see cref="IIdentityDbContext"/>. /// </summary> /// <param name="dbContext"> /// Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database. /// </param> /// <exception cref="ArgumentNullException"> /// Thrown if the <paramref name="dbContext"/> parameter is <c>null</c>. /// </exception> protected internal Table(IIdentityDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException(nameof(dbContext)); } this.dbContext = dbContext; }
public SignUpService( ISmsService smsService, ITotpCodeService totpCodeService, IIdentityDbContext identityDbContext) { _smsService = smsService; _totpCodeService = totpCodeService; _identityDbContext = identityDbContext; }
protected SqlServerBaseStore(IIdentityDbContext identityDbContext, IEventService eventService, IUserResolverService userResolverService, ISerializationSettings serializationSettings) { IdentityDbContext = identityDbContext; EventService = eventService; UserResolverService = userResolverService; SerializationSettings = serializationSettings; }
private async Task <SignUpSession> GetSessionAsync(string email) { IIdentityDbContext db = _testContext.GetDbContext(); SignUpSession session = await db.SignUpSessions.AsQueryable() .Where(x => x.Email == email) .FirstOrDefaultAsync(); return(session); }
public SeedDataCommandHandler( IIdentityDbContext identityDbContext, IAppDbContext dbContext, ISecurityUserManager securityUserManager, IUserRepository userRepo, IDbRunTimeConfig dbRunTimeConfig) { _identityDbContext = identityDbContext; _dbContext = dbContext; _securityUserManager = securityUserManager; _userRepo = userRepo; _dbRunTimeConfig = dbRunTimeConfig; }
public ApplicationUserService(IIdentityDbContext userContext, IPizzaFactoryDbContext pizzaContext, IOrderDbContext orderContext, IMapper mapper, IValidator validator) { Guard.WhenArgument(userContext, nameof(userContext)).IsNull().Throw(); Guard.WhenArgument(pizzaContext, nameof(pizzaContext)).IsNull().Throw(); Guard.WhenArgument(orderContext, nameof(orderContext)).IsNull().Throw(); Guard.WhenArgument(mapper, nameof(mapper)).IsNull().Throw(); Guard.WhenArgument(validator, nameof(validator)).IsNull().Throw(); this.userContext = userContext; this.pizzaContext = pizzaContext; this.orderContext = orderContext; this.mapper = mapper; this.validator = validator; }
/// <summary> /// Checks the given instance of <see cref="IIdentityDbContext"/> to see whether the specified instance of /// <see cref="ITableCommands"/> is <c>null</c>; if so, an <see cref="ArgumentException"/> is thrown. /// </summary> /// <param name="dbContext"></param> /// <param name="propertyToCheck"></param> protected static void ThrowIfTableCommandsIsNull(IIdentityDbContext dbContext, Func <IIdentityDbContext, ITableCommands> propertyToCheck) { if (propertyToCheck == null) { throw new ArgumentNullException(nameof(propertyToCheck)); } ITableCommands tableCommands = propertyToCheck(dbContext); if (tableCommands == null) { var paramName = nameof(dbContext); var message = String.Format(CultureInfo.InvariantCulture, "The table commands specified for the database context cannot be null.{0}Table Commands: {1}", Environment.NewLine, nameof(dbContext.RolesTableCommands)); throw new ArgumentException(message, paramName); } }
public SqlServerUserStore(IIdentityDbContext identityDbContext) { _identityDbContext = identityDbContext; }
public PersistedGrantRepository(IIdentityDbContext loginDbContext) { _loginDbContext = loginDbContext; }
public UserStore(IIdentityDbContext <TUser, TRole> context, ILookupNormalizer normalizer) { _context = context ?? throw new ArgumentNullException(nameof(context)); _normalizer = normalizer; }
public DataSeeder(IIdentityDbContext identityDbContext) { _identityDbContext = identityDbContext; }
public UserRepository(IIdentityDbContext loginDbContext) { _loginDbContext = loginDbContext; }
public ApplicationUserStore(IIdentityDbContext context) : base((IdentityDbContext)context) { }
/// <summary> /// Creates a new instance of the <see cref="RoleStore{TRole}"/> /// class using the provided <see cref="IIdentityDbContext"/>. /// </summary> /// <param name="dbContext"> /// The instance of <see cref="IIdentityDbContext"/> to use when interacting with the database. /// </param> public RoleStore(IIdentityDbContext dbContext) : this(new RolesTable <TRole>(dbContext)) { }
public IdentityDatabase(IIdentityDbContext <ApplicationUser> context) { _context = context; }
public ResourceOwnerPasswordValidator(IIdentityDbContext dbContext, IPasswordValidator passwordValidator) { _passwordValidator = passwordValidator; _dbContext = dbContext; }
public UserCreateRequestHandler(IIdentityDbContext context, IEmailService emailService) { _context = context; _emailService = emailService; }
public UserPasswordResetRequestHandler(IIdentityDbContext context, IHashingService hashingService) { _context = context; _hashingService = hashingService; }
public UserAuthenticateRequestHandler(IIdentityDbContext context, IPasswordValidator passwordValidator, IIdentityServerInteractionService interaction) { _context = context; _passwordValidator = passwordValidator; _interaction = interaction; }
/// <summary> /// Creates a new instance of the <see cref="RolesTable"/> /// class with the specified <see cref="IIdentityDbContext"/>. /// </summary> /// <param name="dbContext"> /// Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database. /// </param> /// <exception cref="ArgumentException"> /// Thrown if the <see cref="IIdentityDbContext.RolesTableCommands"/> /// property of the <paramref name="dbContext"/> parameter is <c>null</c>. /// </exception> internal RolesTable(IIdentityDbContext dbContext) : base(dbContext) { ThrowIfTableCommandsIsNull(dbContext, x => x.RolesTableCommands); }
public SqlServerIdentityResourceStore(IIdentityDbContext identityDbContext) : base(identityDbContext) { }
public SqlServerResourceStore(IIdentityDbContext identityDbContext) { IdentityDbContext = identityDbContext; }
public SqlServerBootstrapper(IIdentityDbContext identityDbContext, ILogger logger) { _identityDbContext = identityDbContext; _logger = logger; }
public SqlServerClientStore(IIdentityDbContext identityDbContext) { _identityDbContext = identityDbContext; }
public SecurityRepository(ILog logger, IIdentityDbContext context) { _logger = logger; _context = context; }
/// <summary> /// Creates a new instance of the <see cref="UsersTable"/> /// class with the specified <see cref="IIdentityDbContext"/>. /// </summary> /// <param name="dbContext"> /// Instance of <see cref="IIdentityDbContext"/> to use when interacting with the database. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown if the <paramref name="dbContext"/> parameter is <c>null</c>. /// </exception> protected UsersTable(IIdentityDbContext dbContext) : base(dbContext) { }