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