1

Orchard caching design:

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 code:

//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 

Question:

Autofac have a method :

object Resolve(Type serviceType, params Parameter[] parameters);

but I cant'find resolve with params at dryioc, how do at dryioc?

Wtower
  • 18,848
  • 11
  • 103
  • 80
try
  • 55
  • 5
  • Welcome to Stack Overflow! I edited your question to format your code sample so that it renders properly - please see the editing help for more information on formatting. Please edit in to provide additional detail that's necessary to identify the specific problem. Good luck! – Wtower Jul 09 '16 at 07:01

1 Answers1

1

Short answer:

container.Resolve<Func<Type, ICacheManager>>()(my parameter ...);
dadhi
  • 4,807
  • 19
  • 25
  • I will leave it here... maybe it can be helpful for others to track status: https://bitbucket.org/dadhi/dryioc/issues/304/add-option-to-pass-values-for-some – Maxim Jul 27 '16 at 12:08