I have an enum class as follows:
namespace Import.DataObject
{
internal enum Status
{
FullTime,
Terminated,
}
}
In my main program I have a DB call then a
foreach (ClientStatus status in databaseStatus)
{
if (status.Name == "FullTime")
{
}
if (status.Name == "Terminated")
{
}
}
How would I set the enum based on the if statements? The Name has an ID associated with it, and I want that ID to = the respecitve name in the enum, I have both the name and id available within the if statement.