Use ToEnum() extension method.