Skip to content

Allow null targets #23

Description

@GraniteStateHacker

Make it so that RetCon attributes can be used to execute ISelfConfig Configure(...) and ISelfConfigAfterBuild PostBuildConfig(...) without forcing any new service registrations. This can be implemented by making the RetCon For property nullable. If the interface is null, don't try to register it in the dependency injection container.

Why?

.NET continues to add utility features that create static dependencies at a layer that makes the architecture dirty.

adding a RedisCache to an API's output (as Aspire likes to do) using

builder.AddRedisOutputCache("cache");

means one must take a dependency on redis cache in the API.

By putting this in a RetCon, the dependency can be cleanly decoupled from the main api assembly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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