Windsor Castle IoC, how to register IBaseService<TObject> to BaseService<TObject, TRepository>
I have something like this:
public interface IBaseService<TObject>
public class BaseService<TObject, TRepository> : IBaseService<TObject>
where TRepository : IRepository<TObject>
I need to register BaseService To IBaseService (the IRepository<> is registere开发者_JAVA百科d)
if you have to do it like this you'd have to override DefaultKernel.BuildCreationContext
(or something like that).
Generally what you're doing is not supported because it's wrong and vague. You're better of being explicit, and creating.
public class Service<TObject> : BaseService<TObject, IRepository<TObject>>
精彩评论