public IActionResult EditHealthInfo([FromBody] HealthInfoDto healthInfoDto) { if (ModelState.IsValid) { healthInfoDto.Time = DateTime.Now; _healthInfoService.EditHealthInfo(healthInfoDto); return(Ok()); } return(BadRequest()); }
public IActionResult AddHealthInfo([FromBody] HealthInfoDto healthInfoDto) { if (ModelState.IsValid) { healthInfoDto.Time = DateTime.Now; _healthInfoService.AddHealthInfo(healthInfoDto); return(StatusCode(StatusCodes.Status201Created)); } return(BadRequest()); }
public void EditHealthInfo(HealthInfoDto healthInfo) { _healthInfoRepository.EditHealthInfo(_mapper.Map <HealthInfoDto, HealthInfo>(healthInfo)); }