Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }