protected T GetRelatedDynamicItem <T>(string fieldName) where T : DynamicTypeBase, new() { DynamicContent relatedItem = this.DynamicContent.GetRelatedItems <DynamicContent>(fieldName).SingleOrDefault(); if (relatedItem == null) { return(null); } IDynamicTypeConverter converter = new DynamicTypeConverter(); return(converter.BuildTypedItem <T>(relatedItem)); }
protected IList <T> GetRelatedDynamicItems <T>(string fieldName) where T : DynamicTypeBase, new() { IQueryable <DynamicContent> relatedItems = this.DynamicContent.GetRelatedItems <DynamicContent>(fieldName); if (relatedItems == null) { return(null); } IDynamicTypeConverter converter = new DynamicTypeConverter(); return(relatedItems.Select(dc => converter.BuildTypedItem <T>(dc)).ToList()); }