public async Task <bool> InsertCruise(CreateCruiseRequest message)
        {
            Cruise cruise = new Cruise();

            cruise.nid           = message.cruise.nid;
            cruise.shipId        = message.cruise.shipId;
            cruise.cabinType     = message.cruise.cabinType;
            cruise.rId           = message.cruise.rId;
            cruise.departureDate = message.cruise.departureDate;
            cruise.isFlight      = message.cruise.isFlight;

            using (var context = new CruiseContext())
            {
                context.cruise.Add(cruise);

                await context.SaveChangesAsync();

                return(true);
            }
        }
        public async Task <bool> InsertPorts(List <Port> ports)
        {
            try
            {
                using (var context = new CruiseContext())
                {
                    foreach (var port in ports)
                    {
                        context.ports.Add(port);
                    }
                    context.Database.SetCommandTimeout(180);
                    await context.SaveChangesAsync();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        public async Task <bool> InsertCabinTypes(List <Cabintype> cabintypes)
        {
            try
            {
                using (var context = new CruiseContext())
                {
                    foreach (var cabintype in cabintypes)
                    {
                        context.cabinTypes.Add(cabintype);
                    }

                    await context.SaveChangesAsync();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        public async Task <bool> InsertCruise(List <CruiseLine> cruiseLines)
        {
            try
            {
                using (var context = new CruiseContext())
                {
                    context.Database.ExecuteSqlCommand("SET IDENTITY_INSERT cruiseLines ON");
                    foreach (var cruiseLine in cruiseLines)
                    {
                        context.cruiseLines.Add(cruiseLine);
                    }
                    await context.SaveChangesAsync();

                    context.Database.ExecuteSqlCommand("SET IDENTITY_INSERT cruiseLines OFF");
                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        public async Task <bool> InsertShip(List <Ship> ships)
        {
            try
            {
                using (var context = new CruiseContext())
                {
                    foreach (var ship in ships)
                    {
                        context.ships.Add(ship);
                    }
                    context.Database.ExecuteSqlCommand("SET IDENTITY_INSERT [dbo].[ships] ON");
                    await context.SaveChangesAsync();

                    context.Database.ExecuteSqlCommand("SET IDENTITY_INSERT [dbo].[ships] OFF");
                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }