Assume we have a lot of complex class CAnimal, and all members of that class are COM Interop compliant. And we have a lot of another class CRecord that has defined public List of CAnimal class as property animals, and is not COM Interop compliant due public usage of generic List<T> type.
for example
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("E58D82B8-9537-4378-92AB-E63F2FAF1EE8")]
public class CAnimal
{
public int id { get; set; }
public string Name { get; set; }
}
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("E58D82B8-9538-4378-92AB-E63F2FAF1EE8")]
public class CRecord
{
public List<CAnimal> animals { get; set; }
}
Criterias: - animals property can be also a null; - has to be strongly typed in COM inteop import (project that consumes this COM interop)
What would be the best practice for COM Interop exporting the List<T> since it is not supported by COM Interop : "Type library exporter warning processing 'Animalia.CRecord.get_animals(#0), Animalia'. Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM."