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

@CosminLazar CosminLazar commented Feb 29, 2016

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()

This comment has been minimized.

@tillig

tillig Feb 29, 2016
Member

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

@tillig
Copy link
Member

@tillig 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

@CosminLazar CosminLazar commented Feb 29, 2016

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
1 check was pending
1 check was pending
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
@tillig
Copy link
Member

@tillig 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.