Eric Vitiello · @pixel
1724 followers · 2341 posts · Server social.pixels.pizza
billseipel · @billseipel
61 followers · 214 posts · Server fosstodon.org

Why... why must I cast this to an INT when the enum's underlying value is... an INT?

int x = (int)myEnum.valueofX;

I am running .Net 6 and according to some... I should not have to cast it.
What gives?

#dotnet #csharp #enum #programming

Last updated 2 years ago

Jens · @schegge42
9 followers · 51 posts · Server nrw.social

Wer Arbeit sparen will und einen AttributeConverter für seine Enum Klassen benötigt findet hier einen AnnotationProcessor, der die Arbeit im Hintergrund erledigt.

schegge.de/2022/10/automatisch

#java #JPA #enum #AnnotationProcessor #ScheggeDe

Last updated 2 years ago

Aljoscha Rittner (beandev) · @beandev
546 followers · 6499 posts · Server social.tchncs.de

Varianten sind schon eine praktische Sache, kommen aber an ihre Grenzen. Oder besser gesagt, ich habe sie fälschlicherweise als struct missbraucht. Sollte man nicht machen. Allerdings muss ich schauen, was man da konfigurieren kann mit , um das so zu haben, wie ich will.

#json #serde #enum

Last updated 2 years ago

Hashtagueule · @hashtagueule
15 followers · 115 posts · Server mamot.fr