【发布时间】:2012-07-08 13:20:14
【问题描述】:
在下面的代码中出现编译错误但我不明白为什么。
class RealMock<TEntity> : DataContext
{
public RealMock():base("")
{
}
public List<TEntity> inMemoryDataStore = new List<TEntity>();
public List<TEntity> GetTable<TEntity>() where TEntity : class
{
return inMemoryDataStore; //Compilation error
}
}
无法将类型“System.Collections.Generic.List [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll]”隐式转换为“System.Collections.Generic” .List [c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll]'
【问题讨论】: