public async Task <IActionResult> CreateCauHinhDoKho(CauHinhDoKhoDTO cauHinhDoKhoDTO) { var cauHinhDoKho = cauHinhDoKhoDTO.ToEntity(); await _cauHinhDoKhoService.CreateCauHinhDoKho(cauHinhDoKho); return(Ok(cauHinhDoKho)); }
public async Task <IActionResult> UpdateCauHinhDoKho(int id, [FromBody] CauHinhDoKhoDTO cauHinhDoKhoDTO) { var cauHinhDoKho = cauHinhDoKhoDTO.ToEntity(); await _cauHinhDoKhoService.UpdateCauHinhDoKho(cauHinhDoKho); return(Ok(cauHinhDoKho)); }
public async Task <IActionResult> GetCauHinhDoKhoById(int id) { var cauHinhDoKho = await _cauHinhDoKhoService.GetCauHinhDoKhoById(id); var result = CauHinhDoKhoDTO.FromEntity(cauHinhDoKho); return(Ok(result)); }