private TwitterViewModel GetTwitterSetting(SettingViewModel setting) { TwitterViewModel twitter = null; if (setting.value != null) { twitter = JsonConvert.DeserializeObject<TwitterViewModel>(setting.value); } else { twitter = new TwitterViewModel() { id = setting.id, alias = setting.alias, name = setting.name }; } return twitter; }
private FacebookViewModel GetFBSetting(SettingViewModel setting) { FacebookViewModel fb = null; if (setting.value != null) { fb = JsonConvert.DeserializeObject<FacebookViewModel>(setting.value); } else { fb = new FacebookViewModel() { id = setting.id, alias = setting.alias, name = setting.name }; } return fb; }
private InstagramViewModel GetIGSetting(SettingViewModel setting) { InstagramViewModel ig = null; if(setting.value != null) { ig = JsonConvert.DeserializeObject<InstagramViewModel>(setting.value); } else { ig = new InstagramViewModel() { id = setting.id, alias = setting.alias, name = setting.name }; } return ig; }
private EmailSettingViewModel GetEmailSetting(SettingViewModel setting) { EmailSettingViewModel email = null; if (setting.value != null) { email = JsonConvert.DeserializeObject<EmailSettingViewModel>(setting.value); } else { email = new EmailSettingViewModel() { id = setting.id, alias = setting.alias, name = setting.name }; } return email; }