Skip to content

Commit

Permalink
Apply suggestion from review
Browse files Browse the repository at this point in the history
  • Loading branch information
joegoldman2 authored and brentschmaltz committed Nov 6, 2023
1 parent 30f096b commit 4b924ed
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ internal T GetValue<T>(string key, bool throwEx, out bool found)
if (long.TryParse(obj.ToString(), out long value))
return (T)(object)value;
}
else if(typeof(T).IsEnum)
{
return (T)Enum.Parse(typeof(T), obj.ToString(), ignoreCase: true);
}
else if (typeof(T) == typeof(string[]))
{
if (objType == typeof(string))
Expand Down Expand Up @@ -321,6 +317,10 @@ internal T GetValue<T>(string key, bool throwEx, out bool found)
else if (typeof(T) == typeof(Collection<object>))
return (T)(object)new Collection<object> { obj };

else if(typeof(T).IsEnum)
{
return (T)Enum.Parse(typeof(T), obj.ToString(), ignoreCase: true);
}
else if (typeof(T) == typeof(DateTime))
{
if (DateTime.TryParse(obj.ToString(), out DateTime value))
Expand Down

0 comments on commit 4b924ed

Please sign in to comment.