public bool TryToObject(object value, out Enum result, EnumValidation validation) { if (value is Enum v) { result = v; return(IsValid(result, validation)); } bool success = _cache.TryToObject(value, out TInt resultAsInt, validation); result = ToEnum(resultAsInt); return(success); }