Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WithAttributedMetadata for individual registrations #11

Open
tillig opened this issue Sep 27, 2021 · 0 comments
Open

WithAttributedMetadata for individual registrations #11

tillig opened this issue Sep 27, 2021 · 0 comments

Comments

@tillig
Copy link
Member

tillig commented Sep 27, 2021

Problem Statement

Registrations for attribute metadata on type seems to differ based on whether the registration comes from assembly scanning or direct individual registration. There is a WithAttributedMetadata extension to scan assemblies and register types with attribute metadata, but if you're registering individual types we assume use of the AttributedMetadataModule which is nice and automatic but inconsistent.

The inconsistency makes it hard to put pieces together and get things to line up right.

Desired Solution

A WithAttributedMetadata extension for individual registrations could even out the inconsistencies.

Make sure that if both the AttributedMetadataModule and the WithAttributedMetadata extension are used that we don't have conflict issues. (I think worst case it'd just set the same metadata twice, but... just something to consider.)

Alternatives You've Considered

Documentation on how to use the MetadataHelper and the standard WithMetadata() extension could sidestep this need, but... it'd be much easier to just add a nice extension method for convenience.

Additional Context

Discovered while looking at some of the documentation inconsistencies in autofac/Documentation#144.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant