Exemplo n.º 1
0
 public object Create(Type type, IEnumerable<string> contracts, object arguments)
 {
     EnsureNotDisposed();
     if (type == null)
         throw new ArgumentNullException("type");
     var name = CreateServiceName(type, contracts);
     Func<object> compiledFactory;
     if (arguments == null && factoryCache.TryGetValue(name, out compiledFactory))
         return compiledFactory();
     var context = new ResolutionContext(this, name.Contracts);
     var result = context.Create(type, null, arguments);
     result.EnsureInitialized(containerContext, result);
     return result.GetSingleValue(containerContext, false, null);
 }