Пример #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));
        }
Пример #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));
        }
Пример #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));
        }