Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }
Exemple #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));
        }