public static void FooBar() { var number = int.Parse(Console.ReadLine()); if (number < 10) { DuplicatedCode.DoSomething(); } else if (number < 20) { DuplicatedCode2.DoSomethingOther(); } else { DuplicatedCode.DoSomething(); } DuplicatedCode.SomeSeparatorCode(); if (number < 10) { DuplicatedCode.DoSomething(); } else if (number < 20) { DuplicatedCode2.DoSomethingOther(); } else { DuplicatedCode.DoSomething(); } }
static void Main(string[] args) { DuplicatedCode.FooBar(); Console.ReadKey(); }