public async Task <IActionResult> Create([Bind("HorseId,HorseName,Location,Notes,Photo")] Horse horse)
        {
            if (ModelState.IsValid)
            {
                _context.Add(horse);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(horse));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("GrainId,GrainName")] Grain grain)
        {
            if (ModelState.IsValid)
            {
                _context.Add(grain);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(grain));
        }
        public async Task <IActionResult> Create([Bind("HorseGrainId,Amount,AMReport,PMReport,HorseId,GrainId")] HorseGrain horseGrain)
        {
            if (ModelState.IsValid)
            {
                _context.Add(horseGrain);
                await _context.SaveChangesAsync();

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