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