Is it possible to use SingleStreamProjection<T> with snapshots? #2641
-
I want to enable snapshots on a document for which I have already a class extending public sealed class SensorProjection : SingleStreamProjection<Sensor> I wanted to reuse Projections.Snapshot<SensorProjection>(SnapshotLifecycle.Inline); This fails. Marten complains that Is there a way to use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You have to understand the concepts of usage clearly, outlining it below:
Conceptually both Projections and Snapshots are very different in terms of their usage. That said, Marten may internally use the constructs to provide these functionality but as an end user you can't interchangeably use these as you wish. |
Beta Was this translation helpful? Give feedback.
@federico-paolillo If you're putting the
Apply()
type methods directly onSensor
, just use:opts.Projections.SelfAggregate<Sensor>(lifecycle)