public async Task <IActionResult> Post([FromBody] SystemParametersDto systemParametersServiceDto) { if (!User.Identity.IsAuthenticated) { throw new AuthenticationException(); } var systemParametersService = _mapper.Map <SystemParameters>(systemParametersServiceDto); await _systemParametersService.InsertSystemParameters(systemParametersService); systemParametersServiceDto = _mapper.Map <SystemParametersDto>(systemParametersService); var response = new ApiResponse <SystemParametersDto>(systemParametersServiceDto); return(Ok(response)); }
public async Task <IActionResult> Put(string code, SystemParametersDto systemParametersServiceDto) { if (!User.Identity.IsAuthenticated) { throw new AuthenticationException(); } var systemParametersService = _mapper.Map <SystemParameters>(systemParametersServiceDto); systemParametersService.Code = code; var result = await _systemParametersService.UpdateSystemParameters(systemParametersService); var response = new ApiResponse <bool>(result); return(Ok(response)); }