点击一个网站我创建一个链接时,我有这样的错误
Error activating IEntityCache using binding from IEntityCache to EntityCache
No constructor was available to create an instance of the implementation type.
Activation path:
4) Injection of dependency IEntityCache into parameter entityCache of constructor of type AlbumRepository
3) Injection of dependency IAlbumRepository into parameter albumRepository of constructor of type AlbumService
2) Injection of dependency IAlbumService into parameter albumService of constructor of type AlbumController
1) Request for AlbumController
Suggestions:
1) Ensure that the implementation type has a public constructor.
2) If you have implemented the Singleton pattern, use a binding with InSingletonScope() instead.
EntityCache是没有公共建筑单身。 因此,这是我怎么做我Ninject绑定
kernel.Bind<IAlbumService>().To<AlbumService>();
kernel.Bind<IAlbumRepository>().To<AlbumRepository>();
kernel.Bind<IDbSetWrapper<Album>>().To<DbSetWrapper<Album>>();
kernel.Bind<IEntityCache>().To<EntityCache>().InSingletonScope();
我究竟做错了什么?
编辑
这里是我的仓库:
public AlbumRepository(DatabaseContext context, IDbSetWrapper<Album> dbSetWrapper, IEntityCache entityCache)
: base(context, dbSetWrapper, entityCache)
如何在IEntityCache通过?