Skip to main content
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

For an example of this Convert.ChangeType() implementation, take a look at Adriano Repetti's answerAdriano Repetti's answer.

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

For an example of this Convert.ChangeType() implementation, take a look at Adriano Repetti's answer.

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

For an example of this Convert.ChangeType() implementation, take a look at Adriano Repetti's answer.

added 170 characters in body
Source Link
Jeroen Vannevel
  • 11.6k
  • 2
  • 39
  • 79

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

For an example of this Convert.ChangeType() implementation, take a look at Adriano Repetti's answer.

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.

For an example of this Convert.ChangeType() implementation, take a look at Adriano Repetti's answer.

Source Link
Jeroen Vannevel
  • 11.6k
  • 2
  • 39
  • 79

You can remove all your if-statements and use Convert.ChangeType() instead. Alternatively, use T4 to generate the code for you and turn it into a partial class. Anything to avoid duplicating like that.