public HttpResponseMessage GetSiteSettings() { var settings = _settingsManager.GetSettings(); var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(JsonConvert.SerializeObject(SettingViewModel.MapList(settings)), Encoding.UTF8, "application/json"); return(response); }
public HttpResponseMessage SaveSiteSettings([FromBody] List <SettingViewModel> settings) { var result = new List <Settings>(); foreach (var settingViewModel in settings) { result.Add(_settingsManager.SetValue(SettingViewModel.Map(settingViewModel))); } var response = this.Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(JsonConvert.SerializeObject(SettingViewModel.MapList(result)), Encoding.UTF8, "application/json"); return(response); }