Beispiel #1
0
        public async Task <IActionResult> Create([Bind("ID,Name,InstructorID,Duration,Date")] Class @class)
        {
            if (ModelState.IsValid)
            {
                _context.Add(@class);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(@class));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("ID,FirstName,Surname,DateOfBirth")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("ID,Name,DateOfBirth")] Instructor instructor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(instructor);
                await _context.SaveChangesAsync();

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