You just need to call .ToString
t.Status = Status.Success.ToString();
ToString () on Enum from MSDN
If you passed an enumeration identifier, you can run:
t.Status = ((Status)enumId).ToString();
It distinguishes an integer from an Enum value, and then calls ToString()
EDIT (best way):
You can even change your method to:
public void CreateStatus(Status status , string userName)
and name it:
CreateStatus(1,"whatever");
and drop to the line:
t.Status = status.ToString();
source
share