コード例 #1
0
        public async Task <IActionResult> Create([Bind("CustomerId,Name,Address,CheckIn,CheckOut,RoomNumber,EmailAddress,Billing")] CustomerModel customerModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customerModel));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("ID,Idnumber,Name,Course,Year,TshirtColor,Size,AmountPaid")] StudentModel studentModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(studentModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(studentModel));
        }