Search code examples
ardalis-cleanarchitecture

NewItemAddedEvent is not Handled


I was reading the Clean Architecture Code and I realized the NewItemAddedEvent in (Clean.Architecture.Core) is not handled, and it's only used on tests.

Is there a reason why it's created as an event and left unhandled? what's its purpose on test?


Solution

  • It’s meant to show how you would use events. The template is trying to stay as small as possible while still showing basic patterns. It’s a fine line between being a sample app, like the eShopOnWeb sample, and being a solution template, where you’re going to replace what’s there with your own code for your own app. Adding full implementations for every possible behavior would just give users more code to have to remove as they create their own app.