| 1234567891011121314151617181920212223242526272829303132 |
- using Abp.Configuration;
- using IwbZero.Authorization.Base.SystemInfo;
- namespace IwbZero.Configuration
- {
- /// <summary>
- /// Implements methods to convert objects between SettingInfo and Setting classes.
- /// </summary>
- internal static class SettingExtensions
- {
- /// <summary>
- /// Creates new <see cref="SysSetting"/> object from given <see cref="SettingInfo"/> object.
- /// </summary>
- public static SysSetting ToSetting(this SettingInfo settingInfo)
- {
- return settingInfo == null
- ? null
- : new SysSetting(settingInfo.TenantId, settingInfo.UserId, settingInfo.Name, settingInfo.Value, "", 0);
- }
- /// <summary>
- /// Creates new <see cref="SettingInfo"/> object from given <see cref="SysSetting"/> object.
- /// </summary>
- public static SettingInfo ToSettingInfo(this SysSetting sysSetting)
- {
- return sysSetting == null
- ? null
- : new SettingInfo(sysSetting.TenantId, sysSetting.UserId, sysSetting.Name, sysSetting.Value);
- }
- }
- }
|