コード例 #1
0
        public async Task <IActionResult> Create([Bind("Name,Email,Id,Status")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("InitialDate,FinalDate,Price,Id,Status")] Parking parking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(parking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(parking));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("LicensePlate,CarModel,Id,Status")] Vehicle vehicle)
        {
            if (ModelState.IsValid)
            {
                _context.Add(vehicle);
                await _context.SaveChangesAsync();

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