Example #1
0
        public async Task <IActionResult> CreateDoanhNghiep(DoanhNghiepDTO doanhNghiepDTO)
        {
            var doanhNghiep = doanhNghiepDTO.ToEntity();
            await _doanhNghiepService.CreateDoanhNghiep(doanhNghiep);

            return(Ok(doanhNghiep));
        }
Example #2
0
        public async Task <IActionResult> UpdateDoanhNghiep(int id, [FromBody] DoanhNghiepDTO doanhNghiepDTO)
        {
            var doanhNghiep = doanhNghiepDTO.ToEntity();
            await _doanhNghiepService.UpdateDoanhNghiep(doanhNghiep);

            return(Ok(doanhNghiep));
        }
Example #3
0
        public async Task <IActionResult> GetDoanhNghiepById(int id)
        {
            var doanhNghiep = await _doanhNghiepService.GetDoanhNghiepById(id);

            var result = DoanhNghiepDTO.FromEntity(doanhNghiep);

            return(Ok(result));
        }