Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,CanTalk,FeathersColor,Name,Gender,DateOfBirth,Weight")] Parrot parrot)
        {
            if (ModelState.IsValid)
            {
                _context.Add(parrot);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(parrot));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,Name,Gender,DateOfBirth,Weight")] Animal animal)
        {
            if (ModelState.IsValid)
            {
                _context.Add(animal);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(animal));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("ID,AmountOfTeeth,NeedSaltWater,SkinColor,Name,Gender,DateOfBirth,Weight")] Shark shark)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shark);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(shark));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("ID,Age,HairColor,Name,Gender,DateOfBirth,Weight")] Gorilla gorilla)
        {
            if (ModelState.IsValid)
            {
                _context.Add(gorilla);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(gorilla));
        }