Allow persistence to be explicitly selected
With the current extension methods, it would seem that the following would be selecting PostgreSql as persisitence:
services.AddEventFlow(o => o.UsePostgreSqlEventStore());
Unfortunately that is not the case, since the TryAdd in this line:
https://github.com/eventflow/EventFlow/blob/develop-v1/Source/EventFlow.PostgreSql/Extensions/EventFlowOptionsPostgresSqlEventStoreExtensions.cs#L34
Won't replace the TryAdd in this line:
https://github.com/eventflow/EventFlow/blob/bb46378162511b53989f6f94357126bc76673dc1/Source/EventFlow/EventFlowOptions.cs#L185
A current workaround would be to either do:
services.TryAddTransient<IEventPersistence, PostgreSqlEventPersistence>();
services.AddEventFlow(o => {});
or
services.AddEventFlow(o => {});
services.AddTransient<IEventPersistence, PostgreSqlEventPersistence>();
But to me it seems that if you specifically use the UsePostgreSqlEventStore extension, it should be safe to add without try (i.e. overrule the sane defaults).
Seems like a good change and possible a mistake on my part when I moved everything to the new extensions