示例#1
0
        public async Task <OkObjectResult> GetSetting()
        {
            var websiteSettingEntity = await _websiteSettingService.GetSetting();

            var viewModel = WebsiteSettingViewModel.FromEntity(websiteSettingEntity);

            return(Ok(viewModel));
        }
示例#2
0
        public static UpdateWebsiteSettingServiceModel FromViewModel(WebsiteSettingViewModel viewModel)
        {
            var settingValues = EntitySettingUtilities.GetSettingValues(viewModel);

            return(new UpdateWebsiteSettingServiceModel
            {
                SettingValues = settingValues
            });
        }
示例#3
0
        public async Task <NoContentResult> UpdateSetting([FromBody] WebsiteSettingViewModel viewModel)
        {
            var updateWebsiteSettingServiceModel = UpdateWebsiteSettingServiceModel.FromViewModel(viewModel);

            updateWebsiteSettingServiceModel.UpdateBy = CurrentUser;

            await _websiteSettingService.UpdateSetting(updateWebsiteSettingServiceModel);

            return(NoContent());
        }