Esempio n. 1
0
        public static async Task Initialize(GoDbContext context,
                                            UserManager <GoUser> userManager,
                                            RoleManager <ApplicationRole> roleManager,
                                            IServiceProvider serviceProvider)
        {
            context.Database.EnsureCreated();
            await SeedUsers.Seed(serviceProvider, context, userManager, roleManager);

            await SeedCourses.Seed(serviceProvider, context);

            await SeedCoursesUsers.Seed(serviceProvider, context);

            await SeedDestinations.Seed(serviceProvider, context);

            await SeedDestinationsUsers.Seed(serviceProvider, context);

            await SeedComments.Seed(serviceProvider, context);

            await SeedStories.Seed(serviceProvider, context);

            await SeedGames.Seed(serviceProvider, context);

            await SeedLevelGameParticipants.Seed(serviceProvider, context);
        }
Esempio n. 2
0
 public DbRepository(GoDbContext context)
 {
     this.context = context;
     this.dbSet   = this.context.Set <TEntity>();
 }