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.
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.