views:

154

answers:

1

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 registered)

+1  A: 

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>>
Krzysztof Koźmic