I have a repository class with optional dependency:
class MyRepository : BaseRepository, IMyRepository { public MyRepository(IDataContext dataContext, IC
I found that RegisterType, instead of Register instance, supports returning null.
container.RegisterType(new InjectionFactory((c) => null));
This was the most straightforward way of getting an actual null to be returned.
null