This PR introduces an improved approach for configuring projections. Mainly:
Improved builder semantics
Addition of a "bare bones" subscription, leaving state management to the consumer.
New DbContext projection context, which doesn't keep the DbContext alive for the lifetime of the process UPDATE: this has been replaced with a more general "service" projection.
Signaling an intial OnCatchingUp notification when subscribing to all events. This allows projection contexts to respond accordingly on the initial catching up phase. For example, to begin a transaction.
OnCatchingUp is also signaled whenever the underlying subscription falls behind (if supported by the infrastructure - e.g. SQLStreamStore)
Add an OnSaved hook, which allows consumers to add behaviour when events are saved. E.g. push a notification.
There is still more work to do in this space, which will be addressed in future PRs. For example:
Support more than one projection
Proper options when configuring with UseSqlStreamStore (this is now done)
Error handling around subscription drops, or exceptions which might occur from any of the projection context hooks
Complete/improve implementation for SQL projections
This PR introduces an improved approach for configuring projections. Mainly:
New DbContext projection context, which doesn't keep the DbContext alive for the lifetime of the processUPDATE: this has been replaced with a more general "service" projection.There is still more work to do in this space, which will be addressed in future PRs. For example:
Proper options when configuring with(this is now done)UseSqlStreamStore