Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,Gym,RecRoom,Computer")] Game game)
        {
            if (ModelState.IsValid)
            {
                game.ID = Guid.NewGuid();
                _context.Add(game);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(game));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,LastName,FirstMidName,email,phone,EnrollmentDate")] Camper camper)
        {
            if (ModelState.IsValid)
            {
                camper.ID = Guid.NewGuid();
                _context.Add(camper);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(camper));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("ID,Breakfast,Lunch,Type")] Meal meal)
        {
            if (ModelState.IsValid)
            {
                meal.ID = Guid.NewGuid();
                _context.Add(meal);
                await _context.SaveChangesAsync();

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