diff --git a/src/Marten.Testing/Events/Projections/custom_transformation_of_events.cs b/src/Marten.Testing/Events/Projections/custom_transformation_of_events.cs index 33d5a224b3..0fc24bfa37 100644 --- a/src/Marten.Testing/Events/Projections/custom_transformation_of_events.cs +++ b/src/Marten.Testing/Events/Projections/custom_transformation_of_events.cs @@ -444,7 +444,7 @@ public async Task default_id_event_should_not_create_new_document() documentCount.ShouldBe(0); } - [Fact] + [Fact(Skip = "Failing test for #1302")] public async Task projectview_withdeleteevent_should_be_respected_during_projection_rebuild() { StoreOptions(_ => diff --git a/src/Marten/DocumentStore.cs b/src/Marten/DocumentStore.cs index 615438fd11..5823d18467 100644 --- a/src/Marten/DocumentStore.cs +++ b/src/Marten/DocumentStore.cs @@ -357,7 +357,7 @@ public IDaemon BuildProjectionDaemon(Type[] viewTypes = null, IDaemonLogger logg if (projections == null) { - projections = viewTypes?.SelectMany(x => Events.AllProjectionsFor(x)).Where(x => x != null).ToArray() ?? Events.AsyncProjections.ToArray(); + projections = viewTypes?.Select(x => Events.ProjectionFor(x)).Where(x => x != null).ToArray() ?? Events.AsyncProjections.ToArray(); } return new Daemon(this, Tenancy.Default, settings ?? new DaemonSettings(), logger ?? new NulloDaemonLogger(), projections); diff --git a/src/Marten/Events/EventGraph.cs b/src/Marten/Events/EventGraph.cs index 74ae444efe..e29deaab9e 100644 --- a/src/Marten/Events/EventGraph.cs +++ b/src/Marten/Events/EventGraph.cs @@ -159,17 +159,11 @@ public string AggregateAliasFor(Type aggregateType) return aggregator.Alias; } - //TODO: This should be merged in V4 with AllForView method to return IEnumerable public IProjection ProjectionFor(Type viewType) { return AsyncProjections.ForView(viewType) ?? InlineProjections.ForView(viewType); } - public IEnumerable AllProjectionsFor(Type viewType) - { - return AsyncProjections.AllForView(viewType).Union(InlineProjections.AllForView(viewType)); - } - public ViewProjection ProjectView() where TView : class { var projection = new ViewProjection(); diff --git a/src/Marten/Events/Projections/ProjectionCollection.cs b/src/Marten/Events/Projections/ProjectionCollection.cs index 9074d7cdb0..1f5a989efb 100644 --- a/src/Marten/Events/Projections/ProjectionCollection.cs +++ b/src/Marten/Events/Projections/ProjectionCollection.cs @@ -84,16 +84,9 @@ public void Add(Func projectionFactory) where T : IProjection _projections.Add(lazyLoadedProjection); } - - //TODO: This should be merged in V4 with AllForView method to return IEnumerable public IProjection ForView(Type viewType) { return _projections.FirstOrDefault(x => x.ProjectedType() == viewType); } - - public IEnumerable AllForView(Type viewType) - { - return _projections.Where(x => x.ProjectedType() == viewType).ToList(); - } } }