Skip to content

Instantly share code, notes, and snippets.

@mario-loza
Last active May 2, 2017 21:52
Show Gist options
  • Save mario-loza/6bdcb00aa9c7fc8741e2bdd5d7f022a7 to your computer and use it in GitHub Desktop.
Save mario-loza/6bdcb00aa9c7fc8741e2bdd5d7f022a7 to your computer and use it in GitHub Desktop.
//Ejemplo A
public enum TipoUsuario
{
Admin,
User
}
//Para verificar un seting
if (tipoUsuario == TipoUsuario.Admin)
{
EsAdmin = true;
}
//Ejemplo B
public enum Operacion
{
ExtensionCredito,
Pago,
VentaActivos
}
//O para definir un proceso dentro de una funcion
if (proceso == Enum.GetName(typeof(Operacion), Operacion.ExtensionCredito))
{
calcularInteres = true;
}
//Eso se podria llamar asi...
this.EjecutarCalculoX(Enum.GetName(typeof(Operacion), Operacion.ExtensionCredito), clienteId: 567)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment