Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("AirportID,Name,latitude,Longitude")] Airport airport)
        {
            if (ModelState.IsValid)
            {
                _context.Add(airport);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(airport));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ID,OriginAirportId,DestinyAirportId")] Flight flight)
        {
            if (ModelState.IsValid)
            {
                _context.Add(flight);
                await _context.SaveChangesAsync();

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