C# 泛型类型用作第二个接口中泛型类型的接口
我有一个引用接受泛型类型的接口:C# 泛型类型用作第二个接口中泛型类型的接口,c#,generics,C#,Generics,我有一个引用接受泛型类型的接口: public interface IEntity<TType> public interface IRepository<T> : IDisposable where T : IEntity, new() 公共接口的可扩展性 我希望将此引用传递给采用泛型类型的第二个接口: public interface IEntity<TType> public interface IRepository<T> : ID
public interface IEntity<TType>
public interface IRepository<T> : IDisposable where T : IEntity, new()
公共接口的可扩展性
我希望将此引用传递给采用泛型类型的第二个接口:
public interface IEntity<TType>
public interface IRepository<T> : IDisposable where T : IEntity, new()
public interface IRepository:IDisposable其中T:IEntity,new()
我已经试着让它工作,但到目前为止还没有建立它
有什么方法可以做到这一点吗?您的界面是
IEntity
,而不是IEntity
。这意味着您的i存款的签名需要反映以下内容:
public interface IEntity<TType>
public interface IRepository<T, TEntity> : IDisposable where T : IEntity<TEntity>, new()
公共接口的可扩展性
公共接口IRepository:IDisposable,其中T:IEntity,new()
到底是什么失败了?是否有错误消息?