我收到以下错误。
类型“Test.ICacheProvider”不能用作泛型类型或方法“StorageManager.Test.IFileInfo”中的类型参数“TStorageProvider”。没有从“StorageManager.Test.ICacheProvider”到“StorageManager.Test.IStorageProvider”的隐式引用转换。
这个程序设计结构有什么问题吗?
程序 :
// Cache Provider Classes
public interface ICacheProvider { }
public class BaseCacheProvider : ICacheProvider { }
public class DerivedCacheProvider : BaseCacheProvider { }
// Storage Classes
public interface IStorageProvider<TCacheProvider> where TCacheProvider :
ICacheProvider { }
public interface BaseStorageProvider<TCacheProvider> :
IStorageProvider<TCacheProvider> where TCacheProvider : ICacheProvider { }
public interface DerivedStorageProvider : BaseStorageProvider<ICacheProvider> { }
// User Classes
public interface IFileInfo<TStorageProvider>
where TStorageProvider : IStorageProvider<ICacheProvider> { }
public class FileInfo : IFileInfo<ICacheProvider> { }