| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using GreenTree.Nachtragsmanagement.Core.Configuration;
- using GreenTree.Nachtragsmanagement.Core.Domain.Config;
- namespace GreenTree.Nachtragsmanagement.Services.Configuration
- {
- public interface IConfigurationService
- {
- /// <summary>
- /// Reads the current configuration from the global config
- /// </summary>
- AppendixConfigurationSection GetCurrentConfiguration();
- #region ConfigItem
- /// <summary>
- /// Gets all configItems
- /// </summary>
- IList<ConfigItem> GetAllConfigItems();
- /// <summary>
- /// Gets a configItem by specified Id
- /// </summary>
- /// <param name="id">ConfigItem identifier.</param>
- ConfigItem GetConfigItemById(int id);
- /// <summary>
- /// Gets a configItem by specified name
- /// </summary>
- /// <param name="name">ConfigItem name.</param>
- ConfigItem GetConfigItemByName(string name);
- /// <summary>
- /// Gets all configItems to the specified ids
- /// </summary>
- IList<ConfigItem> GetConfigItemsByIds(int[] ids);
- /// <summary>
- /// Insert a configItem
- /// </summary>
- /// <param name="configItem">ConfigItem.</param>
- void InsertConfigItem(ConfigItem configItem);
- /// <summary>
- /// Update a configItem
- /// </summary>
- /// <param name="configItem">ConfigItem.</param>
- void UpdateConfigItem(ConfigItem configItem);
- /// <summary>
- /// Delete a configItem
- /// </summary>
- /// <param name="configItem">ConfigItem.</param>
- void DeleteConfigItem(ConfigItem configItem);
- #endregion
- #region Casting
- /// <summary>
- /// Trys to convert the config items value type and returns its actual value, otherwise NULL
- /// </summary>
- /// <typeparam name="T">The actual type.</typeparam>
- /// <param name="configItem">ConfigItem.</param>
- /// <param name="defaultValue">Value, when conversion fails.</param>
- T TryGetConfigItemValue<T>(ConfigItem configItem, T defaultValue);
- /// <summary>
- /// Trys to convert the config items value type and returns its actual value, otherwise NULL
- /// </summary>
- /// <typeparam name="T">The actual type.</typeparam>
- /// <param name="configItemName">ConfigItem name.</param>
- /// <param name="defaultValue">Value, when conversion fails.</param>
- T TryGetConfigItemValue<T>(string configItemName, T defaultValue);
- #endregion
- }
- }
|