public JweBlackListService(
     IDataBaseFactory dataBaseFactory,
     IOptionsMonitor <JweOptions> jweOptions)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.jweOptions      = jweOptions;
 }
Пример #2
0
 public ProfilesVisitsCounterService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
 }
Пример #3
0
 //IServiceAnnonce sa = new ServiceAnnonce(uow);
 public AnnoceController()
 {
     dbf            = new DataBaseFactory();
     uow            = new UnitOfWork(dbf);
     ServiceAnnonce = new ServiceAnnonce();
     ServiceClient  = new ServiceClient();
 }
Пример #4
0
 public ClientController()
 {
     dbf            = new DataBaseFactory();
     uow            = new UnitOfWork(dbf);
     ServiceAnnonce = new Service <Annonce>(uow);
     ServiceClient  = new Service <Client>(uow);
 }
Пример #5
0
 public MenuCache(
     IDataBaseFactory dataBaseFactory,
     IRolesCache rolesCache)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.rolesCache      = rolesCache;
 }
Пример #6
0
 public MaterialsVisitsCounterCache(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
 }
Пример #7
0
 public JwtBlackListService(
     IDataBaseFactory dataBaseFactory,
     IOptions <JwtOptions> jwtOptions)
 {
     this.dataBaseFactory = dataBaseFactory;
     this.jwtOptions      = jwtOptions.Value;
 }
Пример #8
0
        public static void AddIdentity(this IServiceCollection services, IDataBaseFactory dataBaseFactory)
        {
            services.AddIdentity <User, Role>(
                options =>
            {
                options.Password.RequireDigit           = false;
                options.Password.RequireLowercase       = false;
                options.Password.RequireNonAlphanumeric = false;
                options.Password.RequireUppercase       = false;
                options.Password.RequiredUniqueChars    = 2;
                options.Password.RequiredLength         = 6;
                options.User.RequireUniqueEmail         = true;

                const string engChars = "abcdefghijklmnopqrstuvwxyz";
                const string rusChars = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
                const string numbers  = "0123456789";
                const string other    = " -";

                options.User.AllowedUserNameCharacters =
                    engChars + engChars.ToUpper() + rusChars + rusChars.ToUpper() + numbers + other;
            })
            .AddLinqToDBStores <int>(dataBaseFactory)
            .AddUserManager <SunUserManager>()
            .AddRoleManager <SunRoleManager>()
            .AddDefaultTokenProviders();
        }
Пример #9
0
        public static void AddCiphers(this IServiceCollection services, IDataBaseFactory dbFactory)
        {
            CryptService cryptService = new CryptService(dbFactory);

            cryptService.AddCipherKey(CaptchaService.CypherName);
            services.AddSingleton <ICryptService>(cryptService);
        }
Пример #10
0
 public EfRepositoryBase(IDataBaseFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     this.DatabaseFactory = factory;
     _context             = _context ?? (_context = DatabaseFactory.Get());
 }
Пример #11
0
 public SectionsCache(
     IDataBaseFactory dataBaseFactory,
     IRolesCache rolesCache,
     SectionTypes sectionTypes)
 {
     this.rolesCache      = rolesCache;
     this.dataBaseFactory = dataBaseFactory;
     this.sectionTypes    = sectionTypes;
     Initialize();
 }
 public CleanCacheJobsService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache,
     IOptions <SchedulerOptions> schedulerOptions,
     JwtBlackListService jwtBlackListService)
 {
     this.dbFactory           = dbFactory;
     this.spamProtectionCache = spamProtectionCache;
     this.jwtBlackListService = jwtBlackListService;
     this.schedulerOptions    = schedulerOptions.Value;
 }
Пример #13
0
        public OperationKeysContainer(IDataBaseFactory dbFactory)
        {
            using DataBaseConnection db = dbFactory.CreateDb();
            Dictionary <string, int> dictionary = db.OperationKeys
                                                  .ToDictionary(x => x.Name, x => x.OperationKeyId);

            foreach (var propertyInfo in typeof(OperationKeysContainer).GetProperties())
            {
                propertyInfo.SetValue(this, dictionary[propertyInfo.Name]);
            }
        }
Пример #14
0
 public DbContext(IDataBaseFactory dataBaseFactory,
                  IMapToNew <Post, Entities.Post> postMapper,
                  IMapToNew <PostSummary, Entities.PostSummary> postSummaryMapper,
                  IMapToNew <Comment, Entities.Comment> commentMapper,
                  IMapToNew <User, Entities.User> userMapper)
 {
     this.dataBaseFactory   = dataBaseFactory;
     this.postMapper        = postMapper;
     this.commentMapper     = commentMapper;
     this.userMapper        = userMapper;
     this.postSummaryMapper = postSummaryMapper;
 }
Пример #15
0
        public BudgetStatistician Statistic(IDataBaseFactory factory)
        {
            string sql = string.Format("SELECT sum(TB_Budget.Estimate),sum(Actuality),sum((CASE WHEN Level = '{0}' THEN Actuality ELSE 0 END)) FROM TB_Budget", EnumBudgetState.Signed);

            using (var db = factory.OpenDefalutDataBase())
            {
                DataSet set = db.ExecuteSqlToDataSet(sql);
                SumEstimate    = onConvertToDouble(set.Tables[0].Rows[0][0].ToString());
                FinishEstimate = onConvertToDouble(set.Tables[0].Rows[0][1].ToString());
                FinishAcutual  = onConvertToDouble(set.Tables[0].Rows[0][2].ToString());
            }
            return(this);
        }
Пример #16
0
        public CryptService(IDataBaseFactory dbFactory)
        {
            this.dbFactory = dbFactory;

            cipher = new AesManaged
            {
                KeySize   = 256,
                BlockSize = 128,
                Padding   = PaddingMode.ISO10126,
                Mode      = CipherMode.CBC
            };

            Initialize();
        }
Пример #17
0
        public static IServiceCollection AddDatabase(this IServiceCollection services, IConfiguration configuration,
                                                     out IDataBaseFactory dataBaseFactory)
        {
            LinqToDB.Common.Configuration.Linq.AllowMultipleQuery = true;

            var dbFactory = DataBaseFactory.DefaultDataBaseFactory;

            services.AddSingleton <IDataBaseFactory>(dbFactory);
            services.AddScoped(x => dbFactory.CreateDb());

            dataBaseFactory = dbFactory;

            return(services);
        }
Пример #18
0
 public CleanCacheJobsService(
     IDataBaseFactory dbFactory,
     SpamProtectionCache spamProtectionCache,
     IOptionsMonitor <SchedulerOptions> schedulerOptions,
     IMaterialsVisitsCounterCache materialsVisitsCounterCache,
     IProfilesVisitsCounterService profilesVisitsCounterService,
     JweBlackListService jweBlackListService)
 {
     this.dbFactory                    = dbFactory;
     this.spamProtectionCache          = spamProtectionCache;
     this.jweBlackListService          = jweBlackListService;
     this.materialsVisitsCounterCache  = materialsVisitsCounterCache;
     this.profilesVisitsCounterService = profilesVisitsCounterService;
     this.schedulerOptions             = schedulerOptions;
 }
Пример #19
0
        /// <summary>
        /// Add Singleton cache services
        /// </summary>
        public static void AddCaches(this IServiceCollection services, IDataBaseFactory dataBaseFactory)
        {
            services.AddSingleton <IRolesCache>(new RolesCache(dataBaseFactory));

            services.AddSingleton <ICategoriesCache, CategoriesCache>();

            services.AddSingleton <IMenuCache, MenuCache>();

            services.AddSingleton <IComponentsCache, ComponentsCache>();

            services.AddSingleton <IContentCache, CategoryContentCache>();

            services.AddSingleton <CacheKeyGenerator>();

            services.AddSingleton <SpamProtectionCache>();

            services.AddSingleton <IMailTemplatesCache, MailTemplatesCache>();

            services.AddSingleton <CaptchaCacheService>();
        }
Пример #20
0
        public CryptService(IDataBaseFactory dbFactory)
        {
            this.dbFactory = dbFactory;

            cipher = new RijndaelManaged
            {
                KeySize   = 256,
                BlockSize = 128,
                Padding   = PaddingMode.ISO10126,
                Mode      = CipherMode.CBC
            };

            using (var db = dbFactory.CreateDb())
            {
                foreach (var x in db.CipherSecrets)
                {
                    AddCipherKey(x.Name, x.Secret);
                }
            }
        }
Пример #21
0
        private void SubscribeConn_SubscribeMySqlLog(MySqlResponseData data)
        {
            if (data != null)
            {
                IDataBaseFactory dataBaseFactory = null;
                switch (data.DataBaseName.ToLower())
                {
                case "jijiaworkflow":
                    dataBaseFactory = new JiJiaWorkFlowFactory();
                    break;

                default:
                    break;
                }
                if (dataBaseFactory != null)
                {
                    dataBaseFactory.GetTableData(data);
                }
            }
        }
Пример #22
0
 public UnitOfWork(IDataBaseFactory SolutionFactory)
 {
     DBFactory = SolutionFactory;
 }
Пример #23
0
 public ProductRepository(IDataBaseFactory dataBaseFactory) : base(dataBaseFactory)
 {
     dbset = DataContext.Set <PRODUCT>();
 }
Пример #24
0
 public SenderRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Пример #25
0
 public HMRCResponseRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Пример #26
0
 public InvoiceRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Пример #27
0
 public ClientRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
 }
Пример #28
0
 public PeriodDataRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Пример #29
0
 public BusinessRepository(IDataBaseFactory databasefactory) : base(databasefactory)
 {
     this._databasefactory = databasefactory;
 }
Пример #30
0
 public UnitOfWork(IDataBaseFactory factory)
 {
     this.factory = factory;
 }