Skip to content

Commit

Permalink
Add conversion support for long type in ObjectConverter
Browse files Browse the repository at this point in the history
The ObjectConverter file has been updated to support conversion of 'long' type. This is done by adding an additional conditional statement for checking the underlying source type for 'long', then returning the converted value.
  • Loading branch information
sfmskywalker committed Dec 18, 2023
1 parent 3aedf27 commit 8ceb76d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/Elsa.Expressions/Helpers/ObjectConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ public static Result TryConvertTo(this object? value, Type targetType, ObjectCon

if (underlyingSourceType == typeof(double))
return Enum.ToObject(underlyingTargetType, Convert.ChangeType(value, typeof(int)));

if (underlyingSourceType == typeof(long))
return Enum.ToObject(underlyingTargetType, Convert.ChangeType(value, typeof(int)));
}

if (value is string s)
Expand Down

0 comments on commit 8ceb76d

Please sign in to comment.