title: How to avoid code duplication
body: <p>I have three C# methods that <em>almost</em> perform identically. More specifically there is a large amount of code repetition but at the end, they perform different functions.</p>
  
  <p>This is obviously very inefficient, so what's the best way to cut down on code duplication? Should I place it all in one method and use a switch &amp; enum for the different functionality at the end? Alternatively, is there some kind of way you can have 3 separate classes and inherit the shared bit from another? I've done a fair bit of reading about this and from what I can gather, this is only used to gain properties from a whole different class.</p>