public async Task <ActionResult> Edit([Bind(Include = "Id,Name,DateofBirth,PassengerType")] PassengerViewModel passenger)
        {
            passenger.PassengerTypes = GetPassengerTypeList(); // нет, серьезно?! он просто сбрасывал модель при валидации
            if (ModelState.IsValid)
            {
                db.Entry(passenger).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(passenger));
        }
        public Passenger AddorEditPassenger(Passenger passenger)
        {
            try
            {
                if (passenger.Id == 0)
                {
                    passenger.PassengerNo = GetRandom();
                    _dbContext.passengers.Add(passenger);
                    _dbContext.SaveChanges();

                    return(passenger);
                }
                else
                {
                    _dbContext.Entry(passenger).State = System.Data.Entity.EntityState.Modified;
                    _dbContext.SaveChanges();
                    return(passenger);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }