开发者

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>>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜