I noticed a strange behaviour with generic classes using a list of interfaces as a constructor parameter.
Let's say we have the following class
public class GenericClass<T> where T : IInterface
{
public GenericClass(int inInt, List<T> inList){
}
public GenericClass(int inInt, object inObject){
}
}
When I try to create an instance like this (tmpType implements IInterface):
IEnumerable<IInterface> tmpSomeObjects = xy;
Activator.CreateInstance(typeof(GenericClass<>).MakeGenericType(tmpType), 5, (List<IInterface>)tmpSomeObjects);
The second constructor will be called (int, object).
I probably miss an important point... I expected the first constructor to be executed.
ChangeTable<>?List<T>, and we don't know the actual type ofxyortmpSomeObjects(other than what you've declared the variable as).