Exemple #1
0
        private string GetValueConfigDecript(string key1 = null, string key2 = null, string key3 = null)
        {
            var value = GetValueConfig <string>(key1, key2, key3);

            if (!string.IsNullOrWhiteSpace(value))
            {
                return(Base64Encryptor.Decrypt(value));
            }
            return(string.Empty);
        }
Exemple #2
0
        //public static DatabaseInfo DatabaseInfo { get; set; }
        //public static FirebaseAuthInfo FirebaseAuth { get; set; }

        public static void RunKyzinConfigure(this IServiceCollection services, IConfiguration configuration)
        {
            ApplicationName = configuration.GetSection(Constants.ApplicationName).Value;
            DefaultSlogan   = configuration.GetSection(Constants.DefaultSlogan).Value;
            //Encryption = configuration.GetSection(nameof(Encryption)).GetChildren().GetObjectFromSession<EncryptionInfo>();
            //FirebaseAuth = configuration.GetSection(nameof(FirebaseAuthInfo)).GetChildren().GetObjectFromSession<FirebaseAuthInfo>();
            AppSettings = configuration.GetSection(nameof(AppSettings)).GetChildren().GetObjectFromSession <AppSettings>();
            //DatabaseInfo = configuration.GetSection(nameof(DatabaseInfo)).GetChildren().GetObjectFromSession<DatabaseInfo>();
            BaseUrl           = configuration.GetSection(Constants.BaseUrl).Value;
            DateTimeFormat    = configuration.GetSection(Constants.DateTimeFormat).Value;
            TokenValidatePost = configuration.GetSection(Constants.TokenValidatePost).Value;
            PageSize          = int.Parse(configuration.GetSection(Constants.PageSize).Value);
            RelatedPostSize   = int.Parse(configuration.GetSection(Constants.RelatedPostSize).Value);

            var connectionEncrypt = configuration.GetConnectionString("DatabaseLocalConfig");

            if (!string.IsNullOrWhiteSpace(connectionEncrypt))
            {
                ConnectionString = Base64Encryptor.Decrypt(connectionEncrypt);
            }
        }