Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit e3e5b59

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents c1b489a + 874deeb commit e3e5b59

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Bookings.Payments/Program.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,25 @@
1010
Logging.ConfigureLog();
1111

1212
var builder = WebApplication.CreateBuilder(args);
13+
builder.Host.UseSerilog();
1314

1415
builder.Services.AddEndpointsApiExplorer();
1516
builder.Services.AddSwaggerGen();
16-
1717
// OpenTelemetry instrumentation must be added before adding Eventuous services
1818
builder.Services.AddOpenTelemetry();
19-
20-
builder.Services.AddServices(builder.Configuration);
21-
builder.Host.UseSerilog();
19+
builder.Services.AddEventuous(builder.Configuration);
2220

2321
var app = builder.Build();
24-
app.AddEventuousLogs();
2522

26-
app.UseSwagger();
23+
app.AddEventuousLogs();
24+
app.UseSwagger().UseSwaggerUI();
2725
app.UseOpenTelemetryPrometheusScrapingEndpoint();
2826

2927
// Here we discover commands by their annotations
3028
// app.MapDiscoveredCommands();
3129
app.MapDiscoveredCommands<Payment>();
3230

33-
app.UseSwaggerUI();
31+
3432

3533
if (app.Configuration.GetValue<bool>("Postgres:InitializeDatabase")) {
3634
await InitialiseSchema(app);

Bookings.Payments/Registrations.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace Bookings.Payments;
1818

1919
public static class Registrations {
20-
public static void AddServices(this IServiceCollection services, IConfiguration configuration) {
20+
public static void AddEventuous(this IServiceCollection services, IConfiguration configuration) {
2121
NpgsqlConnection GetConnection() => new(configuration["Postgres:ConnectionString"]);
2222

2323
var connectionFactory = new ConnectionFactory {
@@ -27,6 +27,7 @@ public static void AddServices(this IServiceCollection services, IConfiguration
2727

2828
services.AddSingleton(connectionFactory);
2929
services.AddSingleton((GetPostgresConnection)GetConnection);
30+
services.AddSingleton(new PostgresStoreOptions());
3031
services.AddAggregateStore<PostgresStore>();
3132
services.AddApplicationService<CommandService, Payment>();
3233
services.AddSingleton(Mongo.ConfigureMongo(configuration));

0 commit comments

Comments
 (0)