Beispiel #1
0
        public object Resolve(string key)
        {
            if (!_registry.Contains(key))
            {
                throw new InvalidOperationException(
                          string.Format(@"Component cannot be 
                            resolved from key {0} because nothing was registered under that name.", key));
            }
            var reg          = _registry.Get(key);
            var resolverList = (IEnumerable <IResolveObjects>)InternalResolver
                               .ResolveAll(typeof(IResolveObjects));
            var resolver = resolverList.ToList().Find(r => r.CanProcess(reg.ResolutionType));

            return(resolver.Resolve(reg));
        }