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()); }
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(); }
public DoteRepository(LustContext context) : base(context) { }
public AvaliacaoRepository(LustContext context) : base(context) { }
public EFStringLocalizer(LustContext context) { _context = context; }
public ChatRepository(LustContext context) : base(context) { }
public Chat(IMapper mapper, LustContext context, IClienteAppService clienteAppService) { _mapper = mapper; _context = context; _clienteAppService = clienteAppService; }
public PlanoRepository(LustContext context) : base(context) { }
public EntityBaseRepository(LustContext context) { _context = context; }
public Repository(LustContext context) { Db = context; DbSet = Db.Set <TEntity>(); }
public AssinaturaRepository(LustContext context) : base(context) { }
public EFStringLocalizerFactory(IServiceScopeFactory serviceScopeFactory) { var serviceScope = serviceScopeFactory.CreateScope(); _context = serviceScope.ServiceProvider.GetService <LustContext>(); }