private static void MakeTheStackLookMoreImpressive(SomeClass root) { if (root != null) { ByAddingMoreLayers(root); } }
private static void ByAddingMoreLayers(SomeClass root) { if (root.Foo.Value == null || root.Bar.Value.ToString() == "foo" || root.Baz.Value != null) { Console.WriteLine("The code inside the block."); } }
private static SomeClass MakeInstance() { var root = new SomeClass() { Foo = new SomePropertyType() { Value = DateTime.Now }, Bar = new SomePropertyType() { Value = null }, Baz = new SomePropertyType() { Value = new SomePropertyType() } }; return root; }