Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created November 29, 2017 16:27
SF_10.1, SF_10.2, SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/retrieve-related-item-with-single-related-item-limitation
using System.Linq;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.News.Model;
namespace SitefinityWebApp
{
public class RetrieveRelatedDataItems
{
/// <summary>
/// Retrieve a single item, using the RelatedDataPropertyDescriptor in the following way
/// </summary>
/// <param name="item">The parent item</param>
/// <returns>The related speaker</returns>
public IDataItem GetRelatedSpeaker(IDynamicFieldsContainer item)
{
IDataItem relatedSpeaker = item.GetValue<IDataItem>("Speaker");
return relatedSpeaker;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment