AgentMulder.Containers.Autofac.Patterns.RegisterLambdaExpression.GetComponentRegistrations C# (CSharp) Method

GetComponentRegistrations() public method

public GetComponentRegistrations ( ITreeNode registrationRootElement ) : IEnumerable
registrationRootElement ITreeNode
return IEnumerable
        public override IEnumerable<IComponentRegistration> GetComponentRegistrations(ITreeNode registrationRootElement)
        {
            var parentExpression = registrationRootElement.GetParentExpression<IExpressionStatement>();
            if (parentExpression == null)
            {
                yield break;
            }

            IStructuralMatchResult match = Match(registrationRootElement);

            if (match.Matched)
            {
                var expression = match.GetMatchedElement<ICSharpExpression>("expression");

                if (IsResolvedToObject(expression))
                {
                    yield break;
                }

                IEnumerable<IComponentRegistration> componentRegistrations = GetRegistrationsFromExpression(registrationRootElement, expression);

                IEnumerable<FilteredRegistrationBase> basedOnRegistrations = basedOnPatterns.SelectMany(
                   basedOnPattern => basedOnPattern.GetBasedOnRegistrations(parentExpression.Expression)).ToList();

                var registrations = componentRegistrations.Concat(basedOnRegistrations).ToList();

                if (registrations.Any())
                {
                    yield return new CompositeRegistration(registrationRootElement, registrations);
                }
            }
        }