Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable dependency injection for aggregate roots #163

Merged
merged 3 commits into from
Oct 26, 2022
Merged

Conversation

woksin
Copy link
Contributor

@woksin woksin commented Oct 20, 2022

Summary

Enables dependency injection for aggregate roots

Added

  • Tenant scoped dependencies will now be injected in the aggregate roots

Deprecated

  • AggregateRoot base constructor with event source id is no longer necessary

@woksin woksin added the minor label Oct 20, 2022
@woksin woksin requested review from jakhog and mhelleborg and removed request for jakhog October 20, 2022 13:36
@woksin woksin marked this pull request as draft October 20, 2022 13:42
@woksin woksin marked this pull request as ready for review October 20, 2022 13:49
/// <param name="aggregateRootType">The <see cref="Type"/> of the aggregate root.</param>
public EventSourceIdOnAggregateRootNotReady(Type aggregateRootType)
: base($"Event Source has not yet been set on the {aggregateRootType} aggregate root instance. This typically happens when trying to use the {nameof(AggregateRoot.EventSourceId)} property in the constructor." +
$" If this is important then all you need to do is to include in the public constructor a parameter with the {typeof(EventSourceId)} type and use that in the bast constructor, then the {nameof(AggregateRoot.EventSourceId)} property will be accessible in the constructor.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*base :)

Copy link
Member

@mhelleborg mhelleborg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@woksin woksin merged commit 557e671 into master Oct 26, 2022
@woksin woksin deleted the aggregate-root-di branch October 26, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants