public void Update(SystemConfiguration item)
        {
            var parameters = new DynamicParameters(item);

            using (var conn = db.GetOpenConnection())
            {
                string sql = @"UPDATE [dbo].[Configuration]
                               SET [SystemName] = @SystemName
                                  ,[SystemDescription] = @SystemDescription
                                  ,[Timezone] = @TimeZone
                                  ,[SystemDomain] = @SystemDomain
                                  ,[SystemEmail] = @SystemEmail
                                  ,[GoogleOAuthClientID] = @GoogleOAuthClientID
                                  ,[GoogleOAuthClientSecret] = @GoogleOAuthClientSecret
                                  ,[ReCaptchaSiteKey] = @ReCaptchaSiteKey
                                  ,[ReCaptchaSecretKey] = @ReCaptchaSecretKey
                                  ,[GAServiceAccount] = @GAServiceAccount
                                  ,[GAApplicationName] = @GAApplicationName
                                  ,[GAProfileID] = @GAProfileID
                                  ,[GATrackingCode] = @GATrackingCode
                                  ,[FacebookAppID] = @FacebookAppID
                                  ,[FacebookAppSecret] = @FacebookAppSecret
                                  ,[AzureADInstance] = @AzureADInstance
                                  ,[AzureADClientID] = @AzureADClientID
                                  ,[AzureADClientSecret] = @AzureADClientSecret
                                  ,[SendgridUserName] = @SendgridUserName
                                  ,[SendgridPassword] = @SendgridPassword";

                conn.Execute(sql, parameters);
            }
        }
Exemplo n.º 2
0
        public static void LoadConfiguration(SystemConfiguration configurations)
        {
            var type = configurations.GetType();
            var properties = type.GetProperties();

            foreach(PropertyInfo property in type.GetProperties())
            {
                string name = property.Name;
                object value = property.GetValue(configurations, null);
                if (value == null)
                    value = string.Empty;
                CacheProvider.StoreForever(name, value);
            }
        }
 public void UpdateSystemConfiguration(SystemConfiguration configuration)
 {
     configurationRepository.Update(configuration);
 }