//public List<MediaSettingInfo> GetallData(MediaSettingInfo objMediaSetting)
        //{
        //    try
        //    {
        //        List<KeyValuePair<string, object>> param = new List<KeyValuePair<string, object>>();
        //        param.Add(new KeyValuePair<string, object>("@PortalID", objMediaSetting.PortalID));
        //        param.Add(new KeyValuePair<string, object>("@UserModuleID", objMediaSetting.UserModuleID));
        //        param.Add(new KeyValuePair<string, object>("@Culture", objMediaSetting.Culture));
        //        SQLHandler sagesql = new SQLHandler();
        //        return sagesql.ExecuteAsList<MediaSettingInfo>("[dbo].[usp_MediaSetting_GetallData]", param);
        //    }
        //    catch
        //    {
        //        throw;
        //    }
        //}

        //public void DeleteByID(long MediaSettingID)
        //{
        //    try
        //    {
        //        List<KeyValuePair<string, object>> param = new List<KeyValuePair<string, object>>();
        //        param.Add(new KeyValuePair<string, object>("@MediaSettingID", MediaSettingID));
        //        SQLHandler sagesql = new SQLHandler();
        //        sagesql.ExecuteNonQuery("[dbo].[usp_MediaSetting_DeleteByID]", param);
        //    }
        //    catch
        //    {
        //        throw;
        //    }
        //}

        public async Task <int> AddUpdate(MediaSettingInfo objMediaSetting)
        {
            int mediaSettingID = 0;

            List <SQLParam> param = new List <SQLParam>();

            param.Add(new SQLParam("@MediaSettingID", objMediaSetting.MediaSettingID));
            param.Add(new SQLParam("@SettingKeyValue", objMediaSetting.SettingKeyValue));

            try
            {
                SQLExecuteNonQueryAsync sqlHandler = new SQLExecuteNonQueryAsync();
                mediaSettingID = await sqlHandler.ExecuteNonQueryAsync("[dbo].[usp_MediaSetting_InsertUpdate]", param, "@NewMediaSettingID");
            }
            catch
            {
                throw;
            }

            return(mediaSettingID);
        }
        //public List<MediaSettingInfo> GetallData(MediaSettingInfo objMediaSetting)
        //{
        //    MediaSettingDataProvider objDataProvider = new MediaSettingDataProvider();
        //    return objDataProvider.GetallData(objMediaSetting);
        //}


        //public void DeleteByID(long MediaSettingID)
        //{
        //    MediaSettingDataProvider objDataProvider = new MediaSettingDataProvider();
        //    objDataProvider.DeleteByID(MediaSettingID);
        //}

        public async Task <MediaSettingKeys> GetMediaSettingKeyValue()
        {
            MediaSettingKeys objSettingKey = new MediaSettingKeys();

            try
            {
                MediaSettingDataProvider objDataProvider = new MediaSettingDataProvider();
                MediaSettingInfo         settingKeyInfo  = await objDataProvider.GetByID(1);

                if (settingKeyInfo != null && settingKeyInfo.SettingKeyValue.Length > 0)
                {
                    MediaSettingKeyValue objMediaKeys = new MediaSettingKeyValue();
                    objMediaKeys = JsonSerializer.Deserialize <MediaSettingKeyValue>(settingKeyInfo.SettingKeyValue);
                    //objMediaKeys = new JavaScriptSerializer().Deserialize<MediaSettingKeyValue>(settingKeyInfo.SettingKeyValue);
                    objSettingKey = objMediaKeys.MediaSetting;
                }
            }
            catch
            {
                throw;
            }
            return(objSettingKey);
        }
        public async Task <int> AddUpdate(MediaSettingInfo obj)
        {
            MediaSettingDataProvider objDataProvider = new MediaSettingDataProvider();

            return(await objDataProvider.AddUpdate(obj));
        }