Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created September 28, 2017 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NMZivkovic/cb89e28169233c394e063b6ac2d6a5d4 to your computer and use it in GitHub Desktop.
Save NMZivkovic/cb89e28169233c394e063b6ac2d6a5d4 to your computer and use it in GitHub Desktop.
public class Entity
{
public string Type { get; set; }
public int GetNewValueBasedOnType(int newValue)
{
int returnValue;
switch (Type)
{
case "Type0":
returnValue = newValue;
break;
case "Type1":
returnValue = newValue * 2;
break;
case "Type2":
returnValue = newValue * 3;
break;
}
return newValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment