public async Task <IActionResult> Create([Bind("InstructorId,Name,YearOfBirth,PhoneNumber,Email")] Instructor instructor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(instructor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(instructor));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("DrivingCategoryId,CategoryName,Price")] DrivingCategory drivingCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(drivingCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(drivingCategory));
        }
        public async Task <IActionResult> Create([Bind("UserId,Name")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

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