public static async Task SaveAsync <TSetttings>(
            this ISettingService service,
            TSetttings instance) where TSetttings : ISettings
        {
            if (instance == null)
            {
                throw new ArgumentNullException(nameof(instance));
            }

            var settingType = instance.GetType();
            var typeName    = settingType.Name;

            foreach (var prop in settingType.GetProperties())
            {
                if (!prop.CanRead || !prop.CanWrite)
                {
                    continue;
                }

                var key = (typeName + "." + prop.Name).ToLower();

                if (!TypeDescriptor.GetConverter(prop.PropertyType).CanConvertFrom(typeof(string)))
                {
                    continue;
                }

                object value = prop.GetValue(instance, null);

                if (value == null)
                {
                    await service.AddOrUpdateAsync(key, "");
                }
                else
                {
                    string valueString = TypeDescriptor.GetConverter(prop.PropertyType).ConvertToInvariantString(value);

                    await service.AddOrUpdateAsync(key, valueString);
                }
            }

            await service.ClearCacheAsync();
        }
 public async Task CreateOrUpdateAsync([FromBody] Setting model)
 {
     await _settingService.AddOrUpdateAsync(model.Key, model.Value, model.UserId);
 }