Created
October 21, 2017 12:52
-
-
Save dgg/378f325ba4bb2513d3f2bb66c138b681 to your computer and use it in GitHub Desktop.
pissed-by-function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AClassWithOneMethod | |
{ | |
public static int GetOrdering(string someName, SomeAttributeDefinition someAttributeDefinition) | |
{ | |
if (SomeConstants.ACollection.Exists(x => x == someName)) | |
return 20; | |
switch (someName) | |
{ | |
case SomeConstants.AConstant: | |
return 10; | |
case SomeConstants.AnotherConstant: | |
return 30; | |
case SomeConstants.YetAnotherConstant: | |
return 40; | |
default: | |
// SomeAttribute | |
// 51,...,55 or -1 - won't be displayed | |
return 50 + someAttributeDefinition?.Order ?? -1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment