public async Task <OkObjectResult> GetSetting() { var websiteSettingEntity = await _websiteSettingService.GetSetting(); var viewModel = WebsiteSettingViewModel.FromEntity(websiteSettingEntity); return(Ok(viewModel)); }
public static UpdateWebsiteSettingServiceModel FromViewModel(WebsiteSettingViewModel viewModel) { var settingValues = EntitySettingUtilities.GetSettingValues(viewModel); return(new UpdateWebsiteSettingServiceModel { SettingValues = settingValues }); }
public async Task <NoContentResult> UpdateSetting([FromBody] WebsiteSettingViewModel viewModel) { var updateWebsiteSettingServiceModel = UpdateWebsiteSettingServiceModel.FromViewModel(viewModel); updateWebsiteSettingServiceModel.UpdateBy = CurrentUser; await _websiteSettingService.UpdateSetting(updateWebsiteSettingServiceModel); return(NoContent()); }