Enum.ToObject converts an integral value to an enum instance of the given type:
using System;
using System.Numerics;
enum WeekDay
{
Monday, Tuesday, Wednesday, Thursday, Friday
}
class Sample
{
public static void Main()
{
object bs = Enum.ToObject(typeof(WeekDay), 3);
Console.WriteLine(bs);
}
}
The output:
Thursday