Eventuous / eventuous

Event Sourcing library for .NET
https://eventuous.dev
Apache License 2.0
447 stars 71 forks source link

Postgres Store and Sample Booking Application #235

Closed matt-lethargic closed 4 weeks ago

matt-lethargic commented 1 year ago

Describe the bug

When trying to run the sample application I get issues when using the Postgres Event Store

[21:23:31 ERR] Connection id "0HMSS7CKOM6IE", Request id "0HMSS7CKOM6IE:00000001": An unhandled exception was thrown by the application. System.InvalidOperationException: Unable to activate type 'Eventuous.Postgresql.PostgresStore'. The following constructors are ambiguous: Void .ctor(Eventuous.Postgresql.GetPostgresConnection, Eventuous.Postgresql.PostgresStoreOptions, Eventuous.IEventSerializer, Eventuous.IMetadataSerializer) Void .ctor(Eventuous.Postgresql.GetPostgresConnection, Microsoft.Extensions.Options.IOptions'1[Eventuous.Postgresql.PostgresStoreOptions], Eventuous.IEventSerializer, Eventuous.IMetadataSerializer)

To Reproduce Steps to reproduce the behavior:

  1. Add Npgsql 6.0.4 nuget to Bookings and Bookings.Payments
  2. Add Eventuous.Postgres 0.14.1-alpha.0.7 nuget to Bookings
  3. Add the following code to Registrations.cs
        NpgsqlConnection GetConnection() => new(connectionString);
        services.AddSingleton(GetConnection);
        services.AddAggregateStore<PostgresStore>();
  1. Start Bookings application and send request to endpoint
  2. Error is thrown

Expected behavior Sample application works as it does when using EventStoreDB

Screenshots If applicable, add screenshots to help explain your problem.