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);
}
}