Skip to content

Commit

Permalink
enum Type-based method added
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelbaran authored and adecler committed Nov 16, 2019
1 parent f2d0535 commit 0f711dc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Reflection_Engine/Query/EnumValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ public static partial class Query
/**** Public Methods ****/
/***************************************************/

public static IEnumerable<T> EnumValues<T>(this T enumeration)
public static IEnumerable<T> EnumValues<T>(this T enumValue)
{
return Enum.GetValues(enumeration.GetType()).Cast<T>();
return Enum.GetValues(enumValue.GetType()).Cast<T>();
}

/***************************************************/

public static IEnumerable<T> EnumValues<T>(this Type enumType)
{
return Enum.GetValues(enumType).Cast<T>();
}

/***************************************************/
Expand Down

0 comments on commit 0f711dc

Please sign in to comment.