Questions tagged as 'enums'

2
answers

JsonResult Display DisplayName of an Enum

I'm having a problem returning the DisplayName of an enum I have the following Enum public enum TipoPessoa { [Description("Pessoa Fisica")] [Display(Name = "Pessoa Fisica")] [JsonProperty("Pessoa Fisica")]...
asked by 12.09.2017 / 19:47
2
answers

Use of enum in the cases of a switch

Hello, good afternoon. I have a problem with using ENUM to replace a number in the case. In order to make my code more intuitive and do not use numbers in switch cases, I intend to use an ENUM in their place. Example: private static enum En...
asked by 03.03.2017 / 18:31
1
answer

Enumeration Swift 4 - What is its usefulness and how does it work for IOS development?

Well guys, I'm studying a lot to start developing an application in Swift 4 for a job interview, but the Type Enum left me a little, almost nothing, but still confused. I wanted to know a bit more about this Swift 4 language element, how...
asked by 10.08.2018 / 22:17
1
answer

Enum returns null of the bank

Hello, I'm implementing a DAO and doing some testing, I'm having some problems with enums. When running the test class the enum Size returns null, but in the database I have filled records correctly. Test class: package br.com.caelum.jd...
asked by 26.02.2018 / 15:58
1
answer

Go through Enum values in C

Do you have some way to go through the values of Enum in C and display in string format, like in Java, C # and other languages?     
asked by 10.12.2016 / 14:56
1
answer

ENUM returning only the key and not the value

I'm trying in various ways to get the value of an ENUM, but it just returns me its "key." Below is the ENUM: public enum SaleType { BOUGHT("Comprou"), SEND_BUDGET("Enviar Orçamento"), SUBMITTED_BUDGET("Orçamento Enviado"), NOT_...
asked by 18.03.2015 / 20:38
1
answer

How to organize enum in an Ionic project 3

I have a static message group for validating form fields. These messages are present throughout the application and so I would like to use some way to make them dynamic and organized within the framework. Today I have the group organized insi...
asked by 03.01.2019 / 19:03
1
answer

How to assign number to the enum TypeScript name?

All right, guys? Can anyone help me with this problem in TypeScript 2.3. Problem: My backend sends me a property in Json with value 00 or 01, I need to convert to Regular or Extra. But I can not assign numbers in the Enum name, I already trie...
asked by 13.08.2018 / 16:14
1
answer

How to save the custom name of an enum in the database?

I have an Enum TipoPessoa that has LEGAL person and PHYSICAL person. I created a custom (Legal) and (Physical) name. I am getting the custom name to appear on the screen, but in the database you are saving the variable of the LEGAL or PHYSICAL e...
asked by 07.06.2018 / 03:53
1
answer

Can you reference an enum within itself in Python?

I would like to use a constant that I created in one enum as an attribute of another, for example: from enum import Enum class Jokenpo(Enum): PEDRA = ('Rock', [Jokenpo.PAPEL], [Jokenpo.TESOURA]) PAPEL = ('Paper', [Jokenpo.TESOURA], [...
asked by 01.06.2018 / 04:08