What is the best way to get an integer in an enumeration?

Criteria: performance, productivity, productivity.

I need a way to convert uint, int, etc. in its equivalent enum. What is the fastest way to do this using C #?

+3
source share
1 answer

Why can't you just make a direct throw?

MyEnum enumVar = (MyEnum)intVar;
+13
source

Source: https://habr.com/ru/post/1699624/


All Articles