Ninject seems to be having issues resolving the following:
public interface IRepository<TEntity> : IDisposable where TEntity : class,IEntity
{
}
public class Repository<TEntity> : IRepository<TEntity> where TEntity : class,IEntity
{
protected IDbContext _context;
public Repository(IDbContext context)
{
_context = context;
}
}
When there is a need to do something special, I do:
public interface IMyEntityRepository : IRepository<MyEntity>
{
int GetSomeStuffForAnObject();
}
That works great, but binding doesn't work if I am just using the default Repository<T>.
Ok, I must have missed something earlier.
Bind(typeof(IRepository<>)).To(typeof(Repository<>));
Seems to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With