public async Task <IActionResult> Create(KhachHangForCreateDto khachHang) { try { var result = await _repo.Create(khachHang); return(StatusCode(201, new SuccessResponseDto { Message = "Tạo " + _entityName + " mới thành công!", Result = new SuccessResponseResultWithSingleDataDto { Data = result } })); } catch (Exception e) { return(StatusCode(500, new FailedResponseDto { Message = "Tạo " + _entityName + " mới thất bại!", Result = new FailedResponseResultDto { Errors = e } })); } }
public void Create(KhachHangDTO khachhang) { khachhangRepository.Create(iMapper.Map <KhachHangDTO, KhachHang>(khachhang)); }
public bool Create(KhachHangModel model) { return(_res.Create(model)); }