Skip to content

Instantly share code, notes, and snippets.

@dgg
Created October 21, 2017 12:52
Show Gist options
  • Save dgg/378f325ba4bb2513d3f2bb66c138b681 to your computer and use it in GitHub Desktop.
Save dgg/378f325ba4bb2513d3f2bb66c138b681 to your computer and use it in GitHub Desktop.
pissed-by-function
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