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

Cannot create custom RegistrationBuilder #108

Closed
Razenpok opened this issue Feb 2, 2021 · 4 comments
Closed

Cannot create custom RegistrationBuilder #108

Razenpok opened this issue Feb 2, 2021 · 4 comments

Comments

@Razenpok
Copy link

Razenpok commented Feb 2, 2021

IContainerBuilder provides public Register(RegistrationBuilder) method which is completely useless given that all the constructors of RegistrationBuilder are internal. Taking this into account, there are two options:

  1. Change it to internal IContainerBuilder.Register(RegistrationBuilder)
  2. Make RegistrationBuilder more open for extension

IMO (2) is a better option since I've already got into a situation where a custom RegistrationBuilder would be useful.

@hadashiA
Copy link
Owner

hadashiA commented Feb 2, 2021

I got it. I would like to adopt your suggestion (2). That extensibility looks good.
I think suggestion (1) is also possible, but it is a bit complicated because it requires splitting the current interface members to make them internal.

@hadashiA
Copy link
Owner

hadashiA commented Feb 3, 2021

@Razenpok
I am working on such a fix. #110
Changed the constructor of RegistrationBuilder to public.

  • Registration is still internal. However, the members of Registration can be controlled from the Builder.
  • IRegistration is public

Does this fit for your use case?

@Razenpok
Copy link
Author

Razenpok commented Feb 3, 2021

Yeah, this fix should be enough for any case of extensibility I need. Thanks!

@hadashiA
Copy link
Owner

hadashiA commented Feb 4, 2021

Releaed in v1.5.1

@hadashiA hadashiA closed this as completed Feb 4, 2021
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

2 participants