Beispiel #1
0
        public static bool AllMigrationsApplied(this LustContext context)
        {
            var applied = context.GetService <IHistoryRepository>()
                          .GetAppliedMigrations()
                          .Select(m => m.MigrationId);

            var total = context.GetService <IMigrationsAssembly>()
                        .Migrations
                        .Select(m => m.Key);

            return(!total.Except(applied).Any());
        }
Beispiel #2
0
        public SeedDbData(IWebHost host)
        {
            var services     = (IServiceScopeFactory)host.Services.GetService(typeof(IServiceScopeFactory));
            var serviceScope = services.CreateScope();

            _hostingEnv      = serviceScope.ServiceProvider.GetService <IHostingEnvironment>();
            _roleManager     = serviceScope.ServiceProvider.GetService <RoleManager <ApplicationRole> >();
            _userManager     = serviceScope.ServiceProvider.GetService <UserManager <ApplicationUser> >();
            _context         = serviceScope.ServiceProvider.GetService <LustContext>();
            _clienteService  = serviceScope.ServiceProvider.GetService <IClienteAppService>();
            _identityContext = serviceScope.ServiceProvider.GetService <ApplicationDbContext>();;
            CreateRoles(); // Add roles
            CreateUsers(); // Add users
            AddLocalisedData();
            AddOpenIdConnectOptions(serviceScope, CancellationToken.None).GetAwaiter().GetResult();
            AddClientes();
        }
Beispiel #3
0
 public DoteRepository(LustContext context)
     : base(context)
 {
 }
Beispiel #4
0
 public AvaliacaoRepository(LustContext context)
     : base(context)
 {
 }
Beispiel #5
0
 public EFStringLocalizer(LustContext context)
 {
     _context = context;
 }
Beispiel #6
0
 public ChatRepository(LustContext context) : base(context)
 {
 }
Beispiel #7
0
 public Chat(IMapper mapper, LustContext context, IClienteAppService clienteAppService)
 {
     _mapper            = mapper;
     _context           = context;
     _clienteAppService = clienteAppService;
 }
Beispiel #8
0
 public PlanoRepository(LustContext context)
     : base(context)
 {
 }
Beispiel #9
0
 public EntityBaseRepository(LustContext context)
 {
     _context = context;
 }
Beispiel #10
0
 public Repository(LustContext context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }
Beispiel #11
0
 public AssinaturaRepository(LustContext context)
     : base(context)
 {
 }
Beispiel #12
0
        public EFStringLocalizerFactory(IServiceScopeFactory serviceScopeFactory)
        {
            var serviceScope = serviceScopeFactory.CreateScope();

            _context = serviceScope.ServiceProvider.GetService <LustContext>();
        }