public async Task <KHCreateRequest> Create(KHCreateRequest request) { var khachHang = new KhachHang() { MaKH = request.MaKH, TenKH = request.TenKH, DiaChi = request.DiaChi, Email = request.Email, NgaySinh = request.NgaySinh, SDT = request.SDT }; _context.KhachHangs.Add(khachHang); await _context.SaveChangesAsync(); return(request); }
public async Task <IActionResult> Create(KHCreateRequest request) { var result = await _khachHangService.Create(request); return(Ok(result)); }