public ServiceDescriptorsBuilder AddTypesConvention(ITypeSelectionConvention selectionConvention)
        {
            if (selectionConvention == null)
            {
                throw new ArgumentNullException(nameof(selectionConvention));
            }

            _typesConventions.Add(selectionConvention);
            return this;
        }
示例#2
0
        public ServiceDescriptorsBuilder AddTypesConvention(ITypeSelectionConvention selectionConvention)
        {
            if (selectionConvention == null)
            {
                throw new ArgumentNullException(nameof(selectionConvention));
            }

            _typesConventions.Add(selectionConvention);
            return(this);
        }
 private static IEnumerable<Type> GetTypesToRegistration(IEnumerable<Type> potentialTypesToRegister, ITypeSelectionConvention convention)
 {
     try
     {
         var typesToregistration = potentialTypesToRegister.AsParallel().Where(convention.DoesPostSelect);
         return typesToregistration.ToList();
     }
     catch (AggregateException e)
     {
         throw e.FlattenTryBubbleUp();
     }
 }
示例#4
0
 private static IEnumerable <Type> GetTypesToRegistration(IEnumerable <Type> potentialTypesToRegister, ITypeSelectionConvention convention)
 {
     try
     {
         var typesToregistration = potentialTypesToRegister.AsParallel().Where(convention.DoesPostSelect);
         return(typesToregistration.ToList());
     }
     catch (AggregateException e)
     {
         throw e.FlattenTryBubbleUp();
     }
 }