Skip to content

Add lifetime configuration on a per-handler basis #264

@ksladowski

Description

@ksladowski

We spoke on discord about this.

Currently the lifetime of handlers can be configured when registering them into the DI container like so:
services.AddXxxHandlers(lifetime = ServiceLifetime.Scoped)

But there is currently no way to override this setting on a per handler basis. For example, say I wanted to default my handlers to scoped but make a specific handler a transient instead. I'm imagining an argument to the attribute like [Handler(ServiceLifetime.Transient)] or something along those lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions