Skip to content

Decoration example with DeadlockRetry & Validation #111

Closed
@jmzagorski

Description

@jmzagorski

In your decoration section you show an example registering a DeadlockRetryCommandHandlerDecorator and ValidationCommandHandlerDecorator. Since the example is simple with no context, that makes sense. However, if your validator accesses the database to validate state, shouldn't the validator run after the dead lock decorator since data may have changed? I realize the docs are just an example. Your docs have great advice for your library and architecture in general so I wanted to make sure I was not missing something.

container.RegisterDecorator(
    typeof(ICommandHandler<>),
    typeof(TransactionCommandHandlerDecorator<>));

container.RegisterDecorator(
    typeof(ICommandHandler<>),
    typeof(DeadlockRetryCommandHandlerDecorator<>));

container.RegisterDecorator(
    typeof(ICommandHandler<>),
    typeof(ValidationCommandHandlerDecorator<>));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions