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

Simplify ConvertRegistration methods #91

Closed
stefan-lindegger opened this issue Sep 26, 2021 · 1 comment · Fixed by #92
Closed

Simplify ConvertRegistration methods #91

stefan-lindegger opened this issue Sep 26, 2021 · 1 comment · Fixed by #92
Milestone

Comments

@stefan-lindegger
Copy link
Member

stefan-lindegger commented Sep 26, 2021

create to many / to one methods have generic parameters TTargetValue and TConcreteTargetValue.
Reason: TConcreteTargetValue is used to create a concrete object - a parameterless constructor is assumed.
But how a concrete target value is instantiated should be the responsibility of the CreateConvertHelper class.
The type parameters of convert registration methods should be reduced to TTargetValue with class constraint.

When upgrading to the version including this fix you have to:

  • include BBT.StructueTools.Extensions into your projects
  • register the derived IConvertHelperFactory and ICreateConvertHelper interfaces and generic implementations in your IoC container
  • change IConvertHelperFactory respectively ICreateConvertHelper dependencies to the more specific interfaces
  • if necessary reduce the generic type parameters of ICreateConverHelper and factory (TConcreteTarget is partially removed)
@marco-bertschi
Copy link
Contributor

@stefan-lindegger GitFlow can't handle more than one label properly, removed Improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants