Exemplo n.º 1
0
        public void Migrate(IServiceScope serviceScope, string connectionString)
        {
            if (string.IsNullOrEmpty(connectionString))
            {
                return;
            }

            var optionsBuilder = new DbContextOptionsBuilder <StuffPackerDbContext>();

            optionsBuilder.UseSqlServer(connectionString);


            using (var stoConnectDbContext =
                       new StuffPackerDbContext(optionsBuilder.Options, new CurrentMigratorUser()))
            {
                if (!stoConnectDbContext.AllMigrationsApplied())
                {
                    stoConnectDbContext.Database.Migrate();
                }
            }
        }
Exemplo n.º 2
0
 public UserProfileRepository(StuffPackerDbContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public FriendRepository(StuffPackerDbContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public ProductRepository(StuffPackerDbContext context, ICurrentUser currentUser)
 {
     _context     = context;
     _currentUser = currentUser;
 }
Exemplo n.º 5
0
 public PackListsRepository(StuffPackerDbContext context)
 {
     _context = context;
 }
 public PersonalizedProductRepository(StuffPackerDbContext context)
 {
     _context = context;
 }
Exemplo n.º 7
0
 public ProductGroupRepository(StuffPackerDbContext context)
 {
     _context = context;
 }
Exemplo n.º 8
0
 public FollowRepository(StuffPackerDbContext context)
 {
     _context = context;
 }