Exemplo n.º 1
0
        public AbpTemplateDbMigrationService(IDataSeeder dataSeeder, IEnumerable <IAbpTemplateDbSchemaMigrator> dbSchemaMigrators)
        {
            _dataSeeder        = dataSeeder;
            _dbSchemaMigrators = dbSchemaMigrators;

            Logger = NullLogger <AbpTemplateDbMigrationService> .Instance;
        }
Exemplo n.º 2
0
 public DbSeederMiddleware(
     ILogger <DbSeederMiddleware> logger,
     IDataSeeder dataSeeder)
 {
     _logger     = logger;
     _dataSeeder = dataSeeder;
 }
    public async Task StartAsync(CancellationToken cancellationToken)
    {
        using IServiceScope serviceScope = _serviceProvider.CreateScope();
        foreach (string dataSeederTypeName in _dataSeedingOptions.Value.DataSeeders)
        {
            if (String.IsNullOrWhiteSpace(dataSeederTypeName))
            {
                continue;
            }

            Type?dataSeederType = Type.GetType(dataSeederTypeName);
            if (dataSeederType == null)
            {
                throw new OptionsValidationException(
                          nameof(DataSeedingOptions.DataSeeders),
                          typeof(DataSeedingOptions),
                          new[] { $"Data seeder '{dataSeederTypeName}' not found" }
                          );
            }

            if (!typeof(IDataSeeder).IsAssignableFrom(dataSeederType))
            {
                throw new OptionsValidationException(
                          nameof(DataSeedingOptions.DataSeeders),
                          typeof(DataSeedingOptions),
                          new[] { $"Data seeder '{dataSeederTypeName}' must implement {nameof(IDataSeeder)}" }
                          );
            }

            IDataSeeder dataSeeder = (IDataSeeder)ActivatorUtilities.CreateInstance(serviceScope.ServiceProvider, dataSeederType);
            await dataSeeder.Seed(cancellationToken);
        }
    }
Exemplo n.º 4
0
 public ShopDbMigrationService(
     IDataSeeder dataSeeder,
     IEnumerable <IShopDbSchemaMigrator> dbSchemaMigrators)
 {
     this.dataSeeder        = dataSeeder;
     this.dbSchemaMigrators = dbSchemaMigrators;
 }
Exemplo n.º 5
0
 public TigerTenantManagement(
     ITenantRepository tenantRepository,
     ITenantManager tenantManager,
     IDataSeeder dataSeeder
     ) : base(tenantRepository, tenantManager, dataSeeder)
 {
 }
 public PersistDbMigrationService(
     IDataSeeder dataSeeder,
     IEnumerable <IPersistDbSchemaMigrator> dbSchemaMigrators)
 {
     _dataSeeder        = dataSeeder;
     _dbSchemaMigrators = dbSchemaMigrators;
 }
Exemplo n.º 7
0
 public RoomController(
     IRoomRepository roomRepository,
     IDataSeeder dataSeeder)
 {
     _roomRepository = roomRepository;
     _dataSeeder     = dataSeeder;
 }
 public BookStoreDbMigrationService(IDataSeeder dataSeeder,
                                    IBookStoreDbSchemaMigrator dbSchemaMigrator)
 {
     _dataSeeder       = dataSeeder;
     _dbSchemaMigrator = dbSchemaMigrator;
     Logger            = NullLogger <BookStoreDbMigrationService> .Instance;
 }
Exemplo n.º 9
0
 public ApplicationDbContext(DbContextOptions options, IDataSeeder <Kved> kvedSeeder,
                             IDataSeeder <Bank> mfoSeeder, IDataSeeder <Region> regionSeeder)
     : base(options)
 {
     _kvedSeeder   = kvedSeeder;
     _mfoSeeder    = mfoSeeder;
     _regionSeeder = regionSeeder;
 }
 public TenantCreatedDistributedEventHandler(
     IDataSeeder dataSeeder,
     ICurrentTenant currentTenant)
 {
     _dataSeeder    = dataSeeder;
     _currentTenant = currentTenant;
     Logger         = NullLogger <TenantCreatedDistributedEventHandler> .Instance;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceContext"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <param name="dataSeeder">Initial data seeder</param>
 public DeviceContext(DbContextOptions <DeviceContext> options, IDataSeeder dataSeeder)
     : base(options)
 {
     this.dataSeeder = dataSeeder;
     // TODO: Comment below this if you are running migrations commands
     // TODO: uncomment below line of you are running the application for the first time
     //this.Database.EnsureCreated();
 }
Exemplo n.º 12
0
 public SNameDbMigrationService(
     IDataSeeder dataSeeder,
     IEnumerable <ISNameDbSchemaMigrator> dbSchemaMigrators,
     ICurrentTenant currentTenant)
 {
     _dbSchemaMigrators = dbSchemaMigrators;
     _currentTenant     = currentTenant;
 }
Exemplo n.º 13
0
        public DddDemoDbMigrationService(
            IDataSeeder dataSeeder,
            IDddDemoDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <DddDemoDbMigrationService> .Instance;
        }
Exemplo n.º 14
0
        public AdminBackendDbMigrationService(
            IDataSeeder dataSeeder,
            IAdminBackendDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <AdminBackendDbMigrationService> .Instance;
        }
Exemplo n.º 15
0
        public MyProjectDbMigrationService(
            IDataSeeder dataSeeder,
            IEnumerable <IMyProjectDbSchemaMigrator> dbSchemaMigrators)
        {
            _dataSeeder        = dataSeeder;
            _dbSchemaMigrators = dbSchemaMigrators;

            Logger = NullLogger <MyProjectDbMigrationService> .Instance;
        }
        public SoftDeleteTestDbMigrationService(
            IDataSeeder dataSeeder,
            ISoftDeleteTestDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <SoftDeleteTestDbMigrationService> .Instance;
        }
        public PortalDbMigrationService(
            IDataSeeder dataSeeder,
            IPortalDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <PortalDbMigrationService> .Instance;
        }
Exemplo n.º 18
0
        public OtaTicketingDbMigrationService(
            IDataSeeder dataSeeder,
            IOtaTicketingDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <OtaTicketingDbMigrationService> .Instance;
        }
        public AbpPermissionCacheTestDbMigrationService(
            IDataSeeder dataSeeder,
            IAbpPermissionCacheTestDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <AbpPermissionCacheTestDbMigrationService> .Instance;
        }
        public ResearchDbMigrationService(
            IDataSeeder dataSeeder,
            IResearchDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <ResearchDbMigrationService> .Instance;
        }
Exemplo n.º 21
0
        public LoosenDbMigrationService(
            IDataSeeder dataSeeder,
            ILoosenDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <LoosenDbMigrationService> .Instance;
        }
        public QuickTemplateDbMigrationService(
            IDataSeeder dataSeeder,
            IQuickTemplateDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <QuickTemplateDbMigrationService> .Instance;
        }
        public AuroraDbMigrationService(IDataSeeder dataSeeder, ICurrentTenant currentTenant, ITenantRepository tenantRepository, IEnumerable <IAuroraDbSchemaMigrator> dbSchemaMigrators)
        {
            _dataSeeder        = dataSeeder;
            _currentTenant     = currentTenant;
            _tenantRepository  = tenantRepository;
            _dbSchemaMigrators = dbSchemaMigrators;

            Logger = NullLogger <AuroraDbMigrationService> .Instance;
        }
Exemplo n.º 24
0
        public IuguCoreIntegrationDbMigrationService(
            IDataSeeder dataSeeder,
            IIuguCoreIntegrationDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <IuguCoreIntegrationDbMigrationService> .Instance;
        }
        public MaterialSystemDbMigrationService(
            IDataSeeder dataSeeder,
            IMaterialSystemDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <MaterialSystemDbMigrationService> .Instance;
        }
Exemplo n.º 26
0
        public WenitorDbMigrationService(
            IDataSeeder dataSeeder,
            IWenitorDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <WenitorDbMigrationService> .Instance;
        }
Exemplo n.º 27
0
        public CourseSystemDbMigrationService(
            IDataSeeder dataSeeder,
            ICourseSystemDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <CourseSystemDbMigrationService> .Instance;
        }
        public AspNetCrmDbMigrationService(
            IDataSeeder dataSeeder,
            IAspNetCrmDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <AspNetCrmDbMigrationService> .Instance;
        }
 public SaasTenantAppService(
     ISaasTenantRepository tenantRepository,
     ISaasTenantManager tenantManager,
     IDataSeeder dataSeeder)
 {
     DataSeeder       = dataSeeder;
     TenantRepository = tenantRepository;
     TenantManager    = tenantManager;
 }
Exemplo n.º 30
0
        public GrAGRDbMigrationService(
            IDataSeeder dataSeeder,
            IGrAGRDbSchemaMigrator dbSchemaMigrator)
        {
            _dataSeeder       = dataSeeder;
            _dbSchemaMigrator = dbSchemaMigrator;

            Logger = NullLogger <GrAGRDbMigrationService> .Instance;
        }
 public void Configure(
     IApplicationBuilder app,
      ILoggerFactory loggerFactory,
      IDataSeeder dataSeeder
     )
 {         
     app.UseIISPlatformHandler();     
     app.UseFileServer();
     app.UseMvc(routeBuilder => routeBuilder.MapRoute("Default", "{controller=Home}/{action=Index}/{id?}"));      
     app.UseDeveloperExceptionPage();
     app.Run(async (context) =>
     {        
         var logger = loggerFactory.CreateLogger("Catchall Endpoint");
         logger.LogInformation("No endpoint found for request {path}", context.Request.Path);
         await context.Response.WriteAsync("Path does not exist");
     });
     dataSeeder.SeedData();
 }