Refactor Switch to Dictionary

added by KodefuGuru
1/20/2010 12:50:45 PM

2 Kicks, 83 Views

In my post on Z3, I created an extension method for proving an equation. This extension method used a switch statement to analyze a result and return a string. This is a bad practice: the mapping of one type to another is trapped in code. Here's a better way.