Example #1
0
        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);
        }
Example #2
0
        public async Task <IActionResult> Create(KHCreateRequest request)
        {
            var result = await _khachHangService.Create(request);

            return(Ok(result));
        }