I want to filter objects in a List using their type, using OfType<>. My problem is, that some objects are of a generic interf
List
You can use reflection to achieve it:
var filteredList = myList.Where( x => x.GetType() .GetInterfaces() .Any(i => i.IsGenericType && (i.GetGenericTypeDefinition() == typeof(ITraceSeries<>))));