Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gdonega/0038bb33f87fdb11b1f44978349ce4e7 to your computer and use it in GitHub Desktop.
Save gdonega/0038bb33f87fdb11b1f44978349ce4e7 to your computer and use it in GitHub Desktop.
C# - Enum: TiposJogosComSwitch- switch
namespace TiposJogosComSwitch
{
public static class TipoJogoDescricao
{
public static string GetDescricao(this TipoJogo tipoJogo)
{
switch (tipoJogo)
{
case TipoJogo.ACAO:
return "Ação";
case TipoJogo.AVENTURA:
return "Aventura";
case TipoJogo.RPG:
return "Role-playing game";
}
throw new Exception("Descrição não encontrada");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment