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

EventSourcedAggregateRoot dynamic apply #14

Open
leonfs opened this issue Jan 28, 2014 · 1 comment
Open

EventSourcedAggregateRoot dynamic apply #14

leonfs opened this issue Jan 28, 2014 · 1 comment

Comments

@leonfs
Copy link

leonfs commented Jan 28, 2014

   void When(IDomainEvent e)
    {
        (this as dynamic).Apply(e);
  }

    protected void Apply(IDomainEvent e)
    {
        this.mutatingEvents.Add(e);
        When(e);
    }

This code doesn't work, it generates an StackOverflow exception due to it's infinite recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants