c# check if object is of any generic type code example
Example: c# check if object is of any generic type
return list.GetType().GetGenericTypeDefinition() == typeof(List<>);
return list.GetType().GetGenericTypeDefinition() == typeof(List<>);