public async Task <IActionResult> CreateDoanhNghiep(DoanhNghiepDTO doanhNghiepDTO) { var doanhNghiep = doanhNghiepDTO.ToEntity(); await _doanhNghiepService.CreateDoanhNghiep(doanhNghiep); return(Ok(doanhNghiep)); }
public async Task <IActionResult> UpdateDoanhNghiep(int id, [FromBody] DoanhNghiepDTO doanhNghiepDTO) { var doanhNghiep = doanhNghiepDTO.ToEntity(); await _doanhNghiepService.UpdateDoanhNghiep(doanhNghiep); return(Ok(doanhNghiep)); }
public async Task <IActionResult> GetDoanhNghiepById(int id) { var doanhNghiep = await _doanhNghiepService.GetDoanhNghiepById(id); var result = DoanhNghiepDTO.FromEntity(doanhNghiep); return(Ok(result)); }