joliver/EventStore — pull request #119 by vzgromozdun (2012-07-17 10:43:44+00:00)
Title: Get upconverted events

Event upconversion is implemented as special IPipelineHook implementation.

Previously method Store.Advanced.GetFrom(datetime) returns all events without filtering by IPipelineHooks.

I've added thin decorator to IPersistStreams instance passed to OptimisticEventStore. This decorator (PipelineHooksAwarePersistanceDecorator class) do only one thing - replaces original GetFrom(DateTime start) method from IPersistStreams with the following:

```csharp
public IEnumerable GetFrom(DateTime start)
{
foreach (var commit in this.original.GetFrom(start))
{
var filtered = commit;
foreach (var hook in this.pipelineHooks.Where(x => (filtered = x.Select(filtered)) == null))
{
Logger.Info(Resources.PipelineHookSkippedCommit, hook.GetType(), commit.CommitId);
break;
}

if (filtered == null)
Logger.Info(Resources.PipelineHookFilteredCommit);
else
yield return filtered;
}
}
```

In result all events red from persistence storage are filtered by current set of IPipelineHooks registered.
This allows to upconvert whole history! (if upconversion is enabled by EventStore obviously)