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

(Frosting) Support registering open generics #2888

Open
asalvo opened this issue Aug 6, 2019 · 2 comments
Open

(Frosting) Support registering open generics #2888

asalvo opened this issue Aug 6, 2019 · 2 comments

Comments

@asalvo
Copy link

asalvo commented Aug 6, 2019

The Cake Frosting container registration does not support open generics. It throws an exception because the call to IsAssignableFrom fails on line 22 of RegistrationBuilder.

Open generic example:
services.RegisterType(typeof(Logger<>)).As(typeof(ILogger<>)).Singleton();

I have a simple work around at the moment where I just register everything explicitly as there is not that many registrations to do.

There are several examples online of code which claims to create an IsAssignableFrom that supports open generics. Would you accept a pull request that adds support for this?

@devlead
Copy link
Member

devlead commented Aug 6, 2019

Sure we would review such a PR.

@gep13
Copy link
Member

gep13 commented Jul 1, 2020

@asalvo was this something that you were interested in contributing?

@pascalberger pascalberger transferred this issue from cake-archive/frosting Oct 15, 2020
@pascalberger pascalberger changed the title Support registering open generics (Frosting) Support registering open generics Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants