ConsumeRegistration() public méthode

public ConsumeRegistration ( IRegistration registration ) : void
registration IRegistration
Résultat void
 public static ResolverContext CreateContextFromContext(ResolverContext context)
 {
     var resolverContext = new ResolverContext();
     foreach(var usedRegistration in context.UsedRegistrations)
     {
         resolverContext.ConsumeRegistration(usedRegistration);
     }
     return resolverContext;
 }
        public static ResolverContext CreateContextFromContext(ResolverContext context)
        {
            var resolverContext = new ResolverContext();

            foreach (var usedRegistration in context.UsedRegistrations)
            {
                resolverContext.ConsumeRegistration(usedRegistration);
            }
            return(resolverContext);
        }
 public virtual IRegistration LookupType(Query query, ResolverContext context)
 {
     IList<IRegistration> localParents = new List<IRegistration>(context.UsedRegistrations);
     var registrations = componentStore.GetRegistrationsForService(query.ServiceType);
     if (query.Name != null)
     {
         var @default = registrations.SingleOrDefault(p => p.Name == query.Name);
         if (@default == null)
             throw new ServiceNotFoundException(query.ServiceType, query.Name);
         return @default;
     }
     var registration = SkipParents(registrations, localParents);
     if (registration == null)
         return null;
     context.ConsumeRegistration(registration);
     return registration;
 }
Exemple #4
0
        public virtual IRegistration LookupType(Query query, ResolverContext context)
        {
            IList <IRegistration> localParents = new List <IRegistration>(context.UsedRegistrations);
            var registrations = componentStore.GetRegistrationsForService(query.ServiceType);

            if (query.Name != null)
            {
                var @default = registrations.SingleOrDefault(p => p.Name == query.Name);
                if (@default == null)
                {
                    throw new ServiceNotFoundException(query.ServiceType, query.Name);
                }
                return(@default);
            }
            var registration = SkipParents(registrations, localParents);

            if (registration == null)
            {
                return(null);
            }
            context.ConsumeRegistration(registration);
            return(registration);
        }