Revert "Remove unused code"

This reverts commit b0efbdf5e8.
pull/39/head^2
FreddyD 6 years ago
parent b0efbdf5e8
commit b88babc54f

@ -63,6 +63,20 @@ namespace System
&& !type.IsInterface
&& (!type.IsGenericType || !type.IsGenericTypeDefinition);
public static bool IsGrouping(this Type type) => IsGrouping(type.GetTypeInfo());
#if NETCOREAPP3_1
private static bool IsGrouping(TypeInfo type)
=> type.IsGenericType
&& (type.GetGenericTypeDefinition() == typeof(IGrouping<,>)
|| type.GetGenericTypeDefinition() == typeof(SystemInteractiveAsync::System.Linq.IAsyncGrouping<,>));
#else
private static bool IsGrouping(TypeInfo type)
=> type.IsGenericType
&& (type.GetGenericTypeDefinition() == typeof(IGrouping<,>)
|| type.GetGenericTypeDefinition() == typeof(IAsyncGrouping<,>));
#endif
public static Type UnwrapEnumType(this Type type)
{
var isNullable = type.IsNullableType();

Loading…
Cancel
Save