Ejemplo n.º 1
0
        private async Task <WebApiSetting> LoadWebApiSettingAsync(MFWebApiOption option, CancellationToken token)
        {
            var setting = (await webApiSettingQueryProcessor.GetByIdAsync(option.CompanyId, ApiTypeId, token)) ?? new WebApiSetting
            {
                CompanyId      = option.CompanyId,
                ApiTypeId      = ApiTypeId,
                ApiVersion     = option.ApiVersion,
                ClientId       = option.ClientId,
                ClientSecret   = option.ClientSecret,
                ExtractSetting = option.ExtractSetting,
                CreateBy       = option.LoginUserId,
                UpdateBy       = option.LoginUserId,
            };

            if (!string.IsNullOrEmpty(option.ClientId))
            {
                setting.ClientId = option.ClientId;
            }
            if (!string.IsNullOrEmpty(option.ClientSecret))
            {
                setting.ClientSecret = option.ClientSecret;
            }
            if (!string.IsNullOrEmpty(option.ExtractSetting))
            {
                setting.ExtractSetting = option.ExtractSetting;
            }
            return(setting);
        }
Ejemplo n.º 2
0
 public async Task <WebApiSetting> GetByIdAsync(int companyId, int apiTypeId,
                                                CancellationToken token = default(CancellationToken))
 => await webApiSettingQueryProcessor.GetByIdAsync(companyId, apiTypeId, token);