void AddCustomField(long contentId, long?parentContentId, string cultureCode, ref SyndicationItem contentItem) { System.Collections.Generic.IEnumerable <AWAPI_Data.CustomEntities.ContentCustomField> cstFlds = _customFieldLib.GetFieldList(contentId, true); if (cstFlds != null && cstFlds.Count() > 0) { var result = from r in cstFlds where r.applyToSubContents == false && r.fieldContentId.Equals(contentId) || r.applyToSubContents && r.fieldContentId.Equals(parentContentId) orderby r.sortOrder select r; IList <AWAPI_Data.CustomEntities.ContentCustomFieldValueExtended> valueList = _customFieldLib.GetFieldValueList(contentId, cultureCode.ToLower()); foreach (AWAPI_Data.CustomEntities.ContentCustomFieldValueExtended value in valueList) { SyndicationElementExtension extElement = new SyndicationElementExtension(value.title.Trim(), null, AWAPI_Common.library.MiscLibrary.EncodeHtml(AWAPI_Common.library.MiscLibrary.CropSentence(value.fieldValue, MaximumDescLength))); contentItem.ElementExtensions.Add(extElement); } } }
/// <summary> /// /// </summary> /// <param name="siteTagId"></param> /// <returns></returns> public System.Collections.Generic.IList <AWAPI_Data.CustomEntities.ContentCustomField> GetFieldList(long contentId) { return(_contentCustomField.GetFieldList(contentId, true)); }