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

Ignore compiler generated classes on autoregistration #719

Merged
merged 2 commits into from Feb 29, 2016

Conversation

CosminLazar
Copy link
Contributor

When dealing with deferred IEnumerables (using yield return/break) the compiler generates a helper class to handle the deferred execution. Autoregistration discovers this class and registers it as a provider for IEnumerable thus preventing the user from being able to resolve all implementations of T.

When dealing with deferred IEnumerables (using yield return/break) the compiler generates a helper class to handle the deferred execution. Autoregistration discovers this class and registers it as a provider for IEnumerable<T> thus preventing the user from being able to resolve all implementations of T.
@@ -436,5 +436,15 @@ public void ScanningKeyedRegistrationsFilterByAssignabilityBeforeMappingKey()
}));
Assert.True(c.IsRegisteredWithKey<IAService>(k));
}

[Fact]
public void DefferedEnumerableHelperClassDoesNotGetRegistered()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo - two 'f's in the test name "Defferred" => "Deferred"

@tillig
Copy link
Member

tillig commented Feb 29, 2016

Nice catch! I think there's one minor typo to fix up and we can pull it. Thanks!

@CosminLazar
Copy link
Contributor Author

Fixed the typo. Glad that I could help!

tillig added a commit that referenced this pull request Feb 29, 2016
Ignore compiler generated classes on assembly scanning / auto-registration.
@tillig tillig merged commit 2912f66 into autofac:develop Feb 29, 2016
@tillig
Copy link
Member

tillig commented Feb 29, 2016

Pulled. Thanks again!

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

Successfully merging this pull request may close these issues.

None yet

2 participants