Ejemplo n.º 1
0
        public async Task SeedDatabaseAsync()
        {
            await Delete();

            await FluentEntity.InsertInto(Roles).ExecuteAsync();

            await FluentEntity.InsertInto(Cities).ExecuteAsync();

            await FluentEntity.InsertInto(Addresses).ExecuteAsync();

            await FluentEntity.InsertInto(Users).ExecuteAsync();

            await FluentEntity.InsertInto(Genres).ExecuteAsync();

            await FluentEntity.InsertInto(Movies).ExecuteAsync();

            await FluentEntity.InsertInto(Actors).ExecuteAsync();

            await FluentEntity.InsertInto(MovieActors).ExecuteAsync();

            await FluentEntity.InsertInto(CinemaHalls).ExecuteAsync();

            await FluentEntity.InsertInto(RowCategories).ExecuteAsync();

            await FluentEntity.InsertInto(Rows).ExecuteAsync();

            await FluentEntity.InsertInto(Seats).ExecuteAsync();

            await FluentEntity.InsertInto(Schedules).ExecuteAsync();

            await FluentEntity.InsertInto(Reservations).ExecuteAsync();

            await FluentEntity.InsertInto(SeatReservations).ExecuteAsync();
        }
Ejemplo n.º 2
0
        public async Task SeedDatabase()
        {
            if (EntityDependsOnRole())
            {
                Roles = CreateRoles();
                await FluentEntity.InsertInto(Roles).ExecuteAsync();
            }
            if (EntityDependsOnCity())
            {
                Cities = CreateCities();
                await FluentEntity.InsertInto(Cities).ExecuteAsync();
            }
            if (EntityDependsOnAddress())
            {
                Addresses = CreateAddresses();
                await FluentEntity.InsertInto(Addresses).ExecuteAsync();
            }
            if (EntityDependsOnUser())
            {
                Users = CreateUsers();
                await FluentEntity.InsertInto(Users).ExecuteAsync();
            }


            if (EntityDependsOnGenre())
            {
                Genres = CreateGenres();
                await FluentEntity.InsertInto(Genres).ExecuteAsync();
            }
            if (EntityDependsOnMovie())
            {
                Movies = CreateMovies();
                await FluentEntity.InsertInto(Movies).ExecuteAsync();
            }
            if (EntityDependsOnActor())
            {
                Actors = CreateActors();
                await FluentEntity.InsertInto(Actors).ExecuteAsync();
            }
            if (EntityDependsOnMovieActor())
            {
                MovieActors = CreateMovieActors();
                await FluentEntity.InsertInto(MovieActors).ExecuteAsync();
            }

            if (EntityDependsOnCinemaHall())
            {
                CinemaHalls = CreateCinemaHalls();
                await FluentEntity.InsertInto(CinemaHalls).ExecuteAsync();
            }
            if (EntityDependsOnRowCategory())
            {
                RowCategories = CreateRowCategories();
                await FluentEntity.InsertInto(RowCategories).ExecuteAsync();
            }
            if (EntityDependsOnRow())
            {
                Rows = CreateRows();
                await FluentEntity.InsertInto(Rows).ExecuteAsync();
            }
            if (EntityDependsOnSeat())
            {
                Seats = CreateSeats();
                await FluentEntity.InsertInto(Seats).ExecuteAsync();
            }

            if (EntityDependsOnSchedule())
            {
                Schedules = CreateSchedules();
                await FluentEntity.InsertInto(Schedules).ExecuteAsync();
            }

            if (EntityDependsOnReservation())
            {
                Reservations = CreateReservations();
                await FluentEntity.InsertInto(Reservations).ExecuteAsync();
            }

            if (EntityDependsOnSeatReservation())
            {
                SeatReservations = CreateSeatReservations();
                await FluentEntity.InsertInto(SeatReservations).ExecuteAsync();
            }
        }