Answers for "enum to int asp.net core view"

C#
5

C# .net core convert int to enum

if (Enum.IsDefined(typeof(YourEnum), yourInt))
{
    return (YourEnum) yourInt;
}

  OR:

if (Enum.IsDefined(typeof(YourEnum), yourInt))
{
    return (YourEnum) Enum.ToObject(typeof(YourEnum), yourInt);
}
Posted by: Guest on April-27-2020

Code answers related to "enum to int asp.net core view"

C# Answers by Framework

Browse Popular Code Answers by Language