I have the following interface:
public interface IWriter<in TId, TViewModel>
Why there are many different implementations, such as:
public class RedisWriter<TId, TViewModel> : IWriter<TId, TViewModel>
I would like to add an instance of this class to the service constructor:
public class MyService : Service
{
private readonly IWriter<Guid, OrderViewModel> _writer;
public MyService(IWriter<Guid, OrderViewModel> writer)
{
_writer = writer;
}
}
Note that type type parameters are closed where the instance is required.
I see no way to do this in Funq. Is it possible? Or do other IOCs allow such use?
source
share