我想知道为什么我写下面的语句会出错,尽管我在课堂上提到了什么是 T
IList<T> targetObjectsCollection = new List<T>();
for (int counter = 0; counter < dataTransferObjects.Count; counter++)
{
targetObjectsCollection.Add(MappSharePointDAOToDTO(sharePointDaos[counter], dataTransferObjects[counter]));
}
当我将其更改为以下语句时,错误消失了??
IList<IMapperMarker> targetObjectsCollection = new List<IMapperMarker>();
for (int counter = 0; counter < dataTransferObjects.Count; counter++)
{
targetObjectsCollection.Add(MappSharePointDAOToDTO(sharePointDaos[counter], dataTransferObjects[counter]));
}
任何机构都可以描述。