Skip to content

Commit

Permalink
add enum uppercase handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Dec 7, 2022
1 parent 01477f1 commit e576cb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public enum EnumHandlingMode
/// <summary>
/// Convert to lowercase string form
/// </summary>
StringLower
StringLower,

/// <summary>
/// Convert to uppercase string form
/// </summary>
StringUpper
}
}
1 change: 1 addition & 0 deletions src/Utils/ParameterUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ internal static IEnumerable<KeyValuePair<string, string>> GetParameter<T>(object
{
EnumHandlingMode.Numeric => ((int)propertyValue).ToKeyValuePair(keyName, culture),
EnumHandlingMode.StringLower => propertyValue.ToString().ToLower(culture).ToKeyValuePair(keyName, culture),
EnumHandlingMode.StringUpper => propertyValue.ToString().ToUpper(culture).ToKeyValuePair(keyName, culture),

// default includes string handling
_ => propertyValue.ToKeyValuePair(keyName, culture)
Expand Down

0 comments on commit e576cb3

Please sign in to comment.