# Issue with GetCompLink in the Tridion Reference Implementation

We are using a slightly hacked version of the Tridion Reference Implementation as we are using 2009sp1 (don't ask!)

We have a lot of things working well but we have an issue with the function GetMultiComponentLinks.

In the function I can see the following code that I assume goes and gets the data model for the linked components

MethodInfo method = GetType().GetMethod("GetCompLink" + (multival ? "s" : String.Empty), BindingFlags.NonPublic | BindingFlags.Instance);
method = method.MakeGenericMethod(new[] { linkedItemType });
return method.Invoke(this, new object[] { items, linkedItemType });


However when this runs the method is always null. I can't seem to find any reference to GetCompLink either either in the TRI source or DD4T source. If someone can point me in the right direction I would greatly appreciate it!

Interesting one - somehow the Sdl.Web.DD4T.Mapping.DD4TModelBuilder.GetCompLink(s) methods got removed, probably by some over-zealous code analysis which detected unused methods (as the only way they are called is by reflection). As the example models shipped with TRI do not use this (they always use String or Link types for linked content) it was never noticed. I dug out the original source:

private List<T> GetCompLinks<T>(IEnumerable<IComponent> components, Type linkedItemType)
{
List<T> list = new List<T>();
foreach (var comp in components)
{
}
return list;
}

{

list.Add((T)Create(comp, typeof(T)));