Activation Module¶
The activation module allows to configure certain entities to be activated or deactivated according to business necessities.
Integration¶
Depending on the ActivationModule
will automatically register all required
dependencies for filtering out inactive entities (as well as the ones required
to opt out from this behavior). An entity can be made deactivatable by
implementing the corresponding interface
C# | |
---|---|
C# | |
---|---|
Important
Remember to initialize IsActive
field to true unless you want all new
instances of your entity to be created as inactive ones.
The handling of this field is mostly up to the implementor to decide, we only
expose a utility method SetActiveStatus(bool isActive)
. The module will
automatically decorate the newly added field in your entity's class mapping.
Filtering¶
Inactive entities will be filtered out by default. Of course, activation filters
out entities via a global filter specification, which are not applied when
querying via FindByIdAsync
method(or any of its derivatives).
This behavior can be overridden if needed by injecting the IActivationContextManager
.