Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mhelleborg committed Mar 6, 2024
1 parent 2a6eae1 commit 7c3adf5
Show file tree
Hide file tree
Showing 38 changed files with 24 additions and 1,372 deletions.
2 changes: 1 addition & 1 deletion Samples/ASP.NET/Kitchen/Kitchen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Kitchen;
[AggregateRoot("01ad9a9f-711f-47a8-8549-43320f782a1e")]
public class Kitchen : AggregateRoot
{
int _ingredients = 100;
int _ingredients = 2;

public Kitchen(EventSourceId eventSource)
: base(eventSource)
Expand Down
3 changes: 1 addition & 2 deletions Source/Projections/Builder/TypedProjectionMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ public ProjectionResult<TReadModel> TryOn(TReadModel readModel, object @event, P
{
if (@event is not TEvent typedEvent)
{
throw new TypedProjectionMethodInvokedOnEventOfWrongType(typeof(TEvent), @event.GetType());
throw new TypedProjectionMethodInvokedOnEventOfWrongType(typeof(TEvent), @event.GetType());
}

return _method(readModel, typedEvent, context);

}
}
13 changes: 0 additions & 13 deletions Source/Projections/Internal/ProjectionType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ static ProjectionType()
ProjectionModelId = GetProjectionModelId();
}

/// <summary>
/// Creates a new instance of the <see cref="TProjection" />.
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static TProjection Create(Key key)
{
return new TProjection
{
Id = key.Value
};
}

/// <summary>
/// Gets the <see cref="AggregateRootId" /> of an <see cref="AggregateRoot" />.
/// </summary>
Expand Down
4 changes: 1 addition & 3 deletions Source/Projections/Store/Builders/ProjectionStoreBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public IProjectionStore ForTenant(TenantId tenantId)

return new ProjectionStore(
provider,
executionContext,
_projectionAssociations,
_loggerFactory.CreateLogger<ProjectionStore>());
_projectionAssociations);
}
}
50 changes: 0 additions & 50 deletions Source/Projections/Store/CurrentState.cs

This file was deleted.

111 changes: 1 addition & 110 deletions Source/Projections/Store/IProjectionStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,121 +72,12 @@ IProjectionOf<TReadModel> Of<TReadModel>(ProjectionId projectionId)
/// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <typeparamref name="TReadModel"/> read model.</returns>
Task<TReadModel?> Get<TReadModel>(Key key, ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default)
where TReadModel : ProjectionBase, new();

// /// <summary>
// /// Gets a projection read model by key for a projection specified by projection identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="object"/> read model.</returns>
// Task<object> Get(Key key, ProjectionId projectionId, CancellationToken cancellation = default);

// /// <summary>
// /// Gets a projection read model by key for a projection specified by projection and scope identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="scopeId">The <see cref="ScopeId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="object"/> read model.</returns>
// Task<object> Get(Key key, ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default);
//
// /// <summary>
// /// Gets a projection state by key for a projection associated with a type.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <typeparam name="TProjection">The <see cref="Type" /> of the projection.</typeparam>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="CurrentState{TProjection}"/> of <typeparamref name="TProjection"/>.</returns>
// Task<CurrentState<TProjection>> GetState<TProjection>(Key key, CancellationToken cancellation = default)
// where TProjection : class, new();
//
// /// <summary>
// /// Gets a projection state by key for a projection specified by projection identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <typeparam name="TReadModel">The <see cref="Type" /> of the projection.</typeparam>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="CurrentState{TReadModel}"/> of <typeparamref name="TReadModel"/>.</returns>
// Task<CurrentState<TReadModel>> GetState<TReadModel>(Key key, ProjectionId projectionId, CancellationToken cancellation = default)
// where TReadModel : class, new();
//
// /// <summary>
// /// Gets a projection state by key for a projection specified by projection identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="CurrentState{TReadModel}"/> of <see cref="object"/>.</returns>
// Task<CurrentState<object>> GetState(Key key, ProjectionId projectionId, CancellationToken cancellation = default);
//
// /// <summary>
// /// Gets a projection state by key for a projection specified by projection and scope identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="scopeId">The <see cref="ScopeId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <typeparam name="TReadModel">The <see cref="Type" /> of the projection.</typeparam>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="CurrentState{TReadModel}"/> of <typeparamref name="TReadModel"/>.</returns>
// Task<CurrentState<TReadModel>> GetState<TReadModel>(Key key, ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default)
// where TReadModel : class, new();
//
// /// <summary>
// /// Gets a projection state by key for a projection specified by projection and scope identifier.
// /// </summary>
// /// <param name="key">The <see cref="Key" /> of the projection.</param>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="scopeId">The <see cref="ScopeId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="CurrentState{TReadModel}"/> of <see cref="object"/>.</returns>
// Task<CurrentState<object>> GetState(Key key, ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default);


/// <summary>
/// Gets all projection read models for a projection associated with a type.
/// </summary>
/// <typeparam name="TProjection">The <see cref="Type" /> of the projection.</typeparam>
/// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="IEnumerable{T}" /> of <typeparamref name="TProjection" />.</returns>
IQueryable<TProjection> AsQueryable<TProjection>() where TProjection : ProjectionBase, new();

// /// <summary>
// /// Gets all projection read models for a projection specified by projection identifier.
// /// </summary>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <typeparam name="TReadModel">The <see cref="Type" /> of the projection.</typeparam>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="IEnumerable{T}" /> of <typeparamref name="TReadModel" />.</returns>
// Task<IEnumerable<TReadModel>> GetAll<TReadModel>(ProjectionId projectionId, CancellationToken cancellation = default)
// where TReadModel : class, new();
//
// /// <summary>
// /// Gets all projection read models for a projection specified by projection identifier.
// /// </summary>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="IEnumerable{T}" /> of <see cref="object" />.</returns>
// Task<IEnumerable<object>> GetAll(ProjectionId projectionId, CancellationToken cancellation = default);
//
// /// <summary>
// /// Gets all projection read models for a projection specified by projection and scope identifier.
// /// </summary>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="scopeId">The <see cref="ScopeId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <typeparam name="TReadModel">The <see cref="Type" /> of the projection.</typeparam>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="IEnumerable{T}" /> of <typeparamref name="TReadModel" />.</returns>
// Task<IEnumerable<TReadModel>> GetAll<TReadModel>(ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default)
// where TReadModel : class, new();
//
// /// <summary>
// /// Gets all projection read models for a projection specified by projection and scope identifier.
// /// </summary>
// /// <param name="projectionId">The <see cref="ProjectionId"/>.</param>
// /// <param name="scopeId">The <see cref="ScopeId"/>.</param>
// /// <param name="cancellation">The <see cref="CancellationToken" />.</param>
// /// <returns>A <see cref="Task{TResult}" /> that, when resolved, returns the <see cref="IEnumerable{T}" /> of <see cref="object" />.</returns>
// Task<IEnumerable<object>> GetAll(ProjectionId projectionId, ScopeId scopeId, CancellationToken cancellation = default);

}
Loading

0 comments on commit 7c3adf5

Please sign in to comment.