AgentMulder.ReSharper.Domain.Patterns.RegisterWithService.CreateRegistration C# (CSharp) Method

CreateRegistration() private method

private CreateRegistration ( IInvocationExpression invocationExpression, IDeclaredType first, IDeclaredType last ) : IEnumerable
invocationExpression IInvocationExpression
first IDeclaredType
last IDeclaredType
return IEnumerable
        private IEnumerable<IComponentRegistration> CreateRegistration(IInvocationExpression invocationExpression, IDeclaredType first, IDeclaredType last)
        {
            if (first == null || last == null)
            {
                yield break;
            }

            ITypeElement fromType = first.GetTypeElement();
            ITypeElement toType = last.GetTypeElement();

            if (fromType != null && toType != null)
            {
                yield return fromType.Equals(toType)
                                 ? new ComponentRegistration(invocationExpression, fromType)
                                 : new ComponentRegistration(invocationExpression, fromType, toType);
            }
        }