果园缓存设计:
public interface ICacheManager
{
ICache<TKey, TResult> GetCache<TKey, TResult>();
}
class DefaultCacheManager : ICacheManager
{
public DefaultCacheManager(Type component, ICacheHolder cacheHolder)
{
//do something
}
public ICache<TKey, TResult> GetCache<TKey, TResult>()
{
//do somthing
}
}
Autofac代码:
//1.register
builder.RegisterType<DefaultCacheManager>().As<ICacheManager>().SingleInstance();
//2.reslove
// the parameter is dynamic
var parameter = new TypedParameter(do somthing...);
container.Resolve(parameter); //resolve by parameter
问题:
Autofac有一个方法:
object Resolve(Type serviceType, params Parameter[] parameters);
但我在 Dryioc 找不到参数解决方案,在 Dryioc 怎么办?