WIP
This commit is contained in:
parent
54b057886c
commit
7fc1ae0650
204 changed files with 4345 additions and 134 deletions
50
PlanTempus.SetupInfrastructure/Startup.cs
Normal file
50
PlanTempus.SetupInfrastructure/Startup.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using Autofac;
|
||||
using PlanTempus.Core.Configurations;
|
||||
using PlanTempus.Core.Configurations.JsonConfigProvider;
|
||||
using PlanTempus.Core.ModuleRegistry;
|
||||
using PlanTempus.Core.SeqLogging;
|
||||
using PlanTempus.Database.Core;
|
||||
|
||||
namespace PlanTempus.SetupInfrastructure
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public virtual IConfigurationRoot Configuration()
|
||||
{
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.AddJsonFile("appconfiguration.json")
|
||||
.Build();
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
public void ConfigureContainer(ContainerBuilder builder)
|
||||
{
|
||||
|
||||
var configuration = Configuration();
|
||||
|
||||
builder.RegisterModule(new Database.ModuleRegistry.DbPostgreSqlModule
|
||||
{
|
||||
ConnectionString = configuration.GetConnectionString("DefaultConnection")
|
||||
});
|
||||
|
||||
builder.RegisterModule(new TelemetryModule
|
||||
{
|
||||
TelemetryConfig = configuration.GetSection("ApplicationInsights").ToObject<TelemetryConfig>()
|
||||
});
|
||||
|
||||
builder.RegisterModule(new SeqLoggingModule
|
||||
{
|
||||
SeqConfiguration = configuration.GetSection("SeqConfiguration").ToObject<SeqConfiguration>()
|
||||
});
|
||||
|
||||
|
||||
builder.RegisterAssemblyTypes(typeof(IDbConfigure<>).Assembly)
|
||||
.AsClosedTypesOf(typeof(IDbConfigure<>))
|
||||
.AsSelf();
|
||||
|
||||
builder.RegisterType<ConsoleService>();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue