在以下代码中发生编译错误,但我不明白为什么。
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]'