Let’s see how to convert int to enum type in C#, for different versions of .NET Framework and .NET Core.
Читать далееC# — How to cast enum to int (en)?
Добавить комментарий
Let’s see how to convert int to enum type in C#, for different versions of .NET Framework and .NET Core.
Читать далееTo convert an enum type to an int type in C#, you can use type casting. You can simply assign the value of the enum type to a variable of type int. For example:
Для преобразования типа enum в тип int в C#, вы можете использовать приведение типов. Вы можете просто присвоить значение типа enum переменной типа int. Например: