public void Do(IDependency dependency, Foo foo, Foo foo1) { var foo2 = dependency.DoThis(foo, foo1); if (foo2 == null) { foo2 = dependency.DoThis(foo1, foo); } }