public MongoUserStore(IAspLogger logger, IMongoDbService mongoDbService) { this.logger = logger; users = mongoDbService.GetDatabase().MongoDatabase.GetCollection <T>(USERS_COLLECTION_NAME); if (!ManagedIndicies) { ManagedIndicies = true; users.Indexes.CreateOne( Builders <T> .IndexKeys.Ascending(u => u.Name), new CreateIndexOptions <T> { Unique = true, Sparse = false }); users.Indexes.CreateOne( Builders <T> .IndexKeys.Ascending(u => u.NormalizedName), new CreateIndexOptions <T> { Unique = true, Sparse = false }); users.Indexes.CreateOne( Builders <T> .IndexKeys.Ascending(u => u.NormalizedEmail), new CreateIndexOptions <T> { Unique = true, Sparse = false }); users.Indexes.CreateOne( Builders <T> .IndexKeys.Ascending(u => u.Roles), new CreateIndexOptions { Sparse = true, }); users.Indexes.CreateOne( Builders <T> .IndexKeys.Combine( Builders <T> .IndexKeys.Ascending( new StringFieldDefinition <T>( $"{nameof(IdentityUser.Logins)}.{nameof(PersistedUserLoginInfo.LoginProvider)}")), Builders <T> .IndexKeys.Ascending( new StringFieldDefinition <T>( $"{nameof(IdentityUser.Logins)}.{nameof(PersistedUserLoginInfo.ProviderKey)}")) ) ); users.Indexes.CreateOne( Builders <T> .IndexKeys.Combine( Builders <T> .IndexKeys.Ascending( new StringFieldDefinition <T>( $"{nameof(IdentityUser.Claims)}.{nameof(PersistedClaim.Type)}")), Builders <T> .IndexKeys.Ascending( new StringFieldDefinition <T>( $"{nameof(IdentityUser.Claims)}.{nameof(PersistedClaim.Value)}")) ) ); logger.Info("MongoUserStore has been initialized."); } }
public SendEmailService(IAspLogger logger, IOptions <InfoOptions> infoOptions) { Worker = new ParallelGatherSingle <EmailLetter>(DoSendEmail); this.logger = logger; this.infoOptions = infoOptions; logger.Info("SendEmailService is started"); }
public UsersService(IAspLogger logger, IMongoDbService mongoDbService) { this.logger = logger; users = mongoDbService.GetDatabase().MongoDatabase.GetCollection <T>(USERS_COLLECTION_NAME); worker = new ParallelGatherSingle <ProlongationPayment>(DoProlongationPayment); logger.Info("UsersService has been initialized."); }
public IsUserPadAuthorizationHandler( IAspLogger logger, UserManager <IdentityUser> userManager, IUsersService <IdentityUser> usersService ) { this.userManager = userManager; this.logger = logger; this.usersService = usersService; }
public NewsDatabaseService(IAspLogger logger, IMongoDbService mongoDbService) { this.logger = logger; var databaseFactory = mongoDbService.GetDatabase(); this.newsDatabase = NewsDatabase.Init(databaseFactory); logger.Info("NewsDatabaseService has been initialized."); }
public MongoDbService(IAspLogger logger, IOptions <DatabaseOptions> databaseOptions) { var mongoCredentials = new MongoDbCredentials( databaseOptions.Value.MongoDb.User, databaseOptions.Value.MongoDb.Password, databaseOptions.Value.MongoDb.Database, databaseOptions.Value.MongoDb.Host); this.databaseFactory = DatabaseFactory.Init(mongoCredentials); logger.Info("MongoDbService has been initialized."); }
public AdminController( IAspLogger logger, IUsersService <IdentityUser> usersService, UserManager <IdentityUser> userManager, IAdvertsDatabaseService advertsDatabaseService ) { this.logger = logger; this.userManager = userManager; this.usersService = usersService; this.advertsDatabaseService = advertsDatabaseService; }
public PaymentController( IAspLogger logger, UserManager <IdentityUser> userManager, IOptions <InfoOptions> infoOptions, ISmsRuService smsService, IUsersService <IdentityUser> usersService) { this.logger = logger; this.usersService = usersService; this.userManager = userManager; this.infoOptions = infoOptions; this.smsService = smsService; }
public AdvertsDatabaseService(IAspLogger logger, IMongoDbService mongoDbService, IOptions <AdvertsOptions> advertsOptions) { this.logger = logger; var databaseFactory = mongoDbService.GetDatabase(); this.advertsDatabase = AdvertsDatabase.Init(databaseFactory, advertsOptions); this.advertsOptions = advertsOptions; logger.Info("AdvertsDatabaseService has been initialized."); logger.Info($"Adverts directories: RootDirectory={advertsOptions.Value.RootDirectory}, NfsDirectory={advertsOptions.Value.NfsDirectory}, FilesDirectory={advertsOptions.Value.FilesDirectory}"); }
public SmsRuService(IAspLogger logger, IOptions <SmsRuOptions> options) { this.logger = logger; this.login = options.Value.Login; this.password = options.Value.Password; this.apiId = options.Value.ApiId; this.partnerId = options.Value.PartnerId; this.from = options.Value.From; this.translit = options.Value.Translit; this.test = options.Value.Test; Worker = new ParallelGatherSingle <SmsMessage>(DoSendSms); logger.Info($"SmsRuService has been initialized."); }
public ProfileController( IAspLogger logger, UserManager <IdentityUser> userManager, SignInManager <IdentityUser> signInManager, ISendEmailService sendEmail, ISmsRuService smsService, IUsersService <IdentityUser> usersService, IOptions <InfoOptions> infoOptions, IHostingEnvironment env, IViewRenderService viewRender) { this.userManager = userManager; this.signInManager = signInManager; this.logger = logger; this.sendEmail = sendEmail; this.smsService = smsService; this.viewRender = viewRender; this.usersService = usersService; this.infoOptions = infoOptions; this.env = env; }
public MongoRoleStore(IAspLogger logger, IMongoDbService mongoDbService) { this.logger = logger; roles = mongoDbService.GetDatabase().MongoDatabase.GetCollection <IdentityRole>(ROLES_COLLECTION_NAME); if (!ManagedIndicies) { ManagedIndicies = true; roles.Indexes.CreateOne( Builders <IdentityRole> .IndexKeys.Ascending(r => r.NormalizedName), new CreateIndexOptions { Unique = true, Sparse = false, Background = true }); logger.Info("MongoRoleStore has been initialized."); } }
public HomeController(IAspLogger logger, IViewRenderService viewRender, ISendEmailService sendEmail) { Log = logger; ViewRender = viewRender; SendEmail = sendEmail; }