AdvantageModuleEngine..::..GetPublishedObjectsBykey<(Of <(<'T>)>)> Method (List<(Of <(<'ObjectKeyCriteria>)>)>)
Gets the published objects by matching criteria (Inner Join)
Namespace:
AdvantageCMS.Core.Common.EngineAssembly: AdvantageCMS.Core (in AdvantageCMS.Core.dll)
Syntax
public List<T> GetPublishedObjectsBykey<T>( List<ObjectKeyCriteria> criteria ) where T : BusinessObject<T>, BusinessObject<T>, BusinessObject<T>, BusinessObject<T>, BusinessObject<T>, BusinessObject<T>, BusinessObject<T>
Type Parameters
- T
- T must inherit from BusinessObject
Parameters
- criteria
- Type: List<(Of <(<'ObjectKeyCriteria>)>)>
A List of index criteria requirements that must match to generate the return list. (Inner Join)
Return Value
List<T>Examples
Sample is a NewsArticle Object that has indexes on "NewsDate" and "Author" defined (in the NewsArticle BusinessObject)
Set criteria to only return records where the "NewsDate" article was in the month of January 2020, and the Author was "Sam Smith"
C#
ObjectKeyCriteria oCriteria1 = new ObjectKeyCriteria { Key = "NewsDate", Comparison = eComparison.GreaterOrEquals, Value = new DateTime(2020, 1, 1), DataType = eObjectKeyCriteriaDataType.Date }; ObjectKeyCriteria oCriteria2 = new ObjectKeyCriteria { Key = "NewsDate", Comparison = eComparison.LessOrEquals, Value = new DateTime(2020, 1, 31), DataType = eObjectKeyCriteriaDataType.Date }; ObjectKeyCriteria oCriteria3 = new ObjectKeyCriteria { Key = "Author", Comparison = eComparison.Like, Value = "Sam Smith", DataType = eObjectKeyCriteriaDataType.String }; List<NewsArticle> myList = ModuleEngine.GetPublishedObjectsBykey<NewsArticle>(new List<ObjectKeyCriteria> { oCriteria1, oCriteria2, oCriteria3 });