Update to latest version and show additional features
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using GerstITS.Data.EntityFramework;
|
||||
using GerstITS.Examples.JobDashboard.Configurations;
|
||||
using GerstITS.Examples.JobDashboard.Data;
|
||||
using GerstITS.Examples.JobDashboard.Jobs;
|
||||
using GerstITS.IoC;
|
||||
using GerstITS.Job.Scheduling;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace GerstITS.Examples.JobDashboard;
|
||||
|
||||
public sealed class Module : IIoCModule<IServiceCollection>
|
||||
{
|
||||
#region IIoCModule
|
||||
|
||||
public void RegisterComponents(IServiceCollection container)
|
||||
{
|
||||
RegisterInMemoryStore(container);
|
||||
RegisterJobs(container);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private static void RegisterInMemoryStore(IServiceCollection container)
|
||||
{
|
||||
// The InMemory provider has no migrations, so disable the framework's auto-migration startup task.
|
||||
container.AddSingleton<IEntityFrameworkMigrationConfiguration, NoDatabaseMigrationConfiguration>();
|
||||
|
||||
// Wire the EF Core InMemory provider through the framework's session (unit of work). No real database.
|
||||
container.AddScoped<IDatabaseConfigurator, InMemoryDatabaseConfigurator>();
|
||||
container.AddTransient(_ => new DbContextOptionsBuilder<JobRunDbContext>().Options);
|
||||
container.AddScoped<JobRunDbContext>();
|
||||
container.AddEntityFrameworkSession<JobRunDbContext>();
|
||||
}
|
||||
|
||||
private static void RegisterJobs(IServiceCollection container)
|
||||
{
|
||||
container.RegisterJob<ReportGenerationJob, ReportGenerationJobConfiguration>(IgnoreConditions.EntityFramework, IgnoreConditions.Swagger);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user