/// <summary> /// Initializes a new instance of the <see cref="UPCRMCachedResult"/> class. /// </summary> /// <param name="result"> /// The result. /// </param> /// <param name="condition"> /// The condition. /// </param> public UPCRMCachedResult(UPCRMResult result, UPCRMResultCondition condition) : base(result.MetaInfo, result.IsServerResult ? result.ServerResponse() : result.RecordSet()) { this.BaseResult = result; var resultRowArray = new List <UPCRMResultRow>(); int i, count = result.RowCount; for (i = 0; i < count; i++) { var row = (UPCRMResultRow)this.ResultRowAtIndex(i); if (condition.Check(row)) { resultRowArray.Add(row); } } this.ResultRows = resultRowArray; }
/// <summary> /// Conditions the by appending or condition. /// </summary> /// <param name="condition"> /// The condition. /// </param> /// <returns> /// The <see cref="UPCRMResultCondition"/>. /// </returns> public UPCRMResultCondition ConditionByAppendingORCondition(UPCRMResultCondition condition) { return(new UPCRMResultORCondition(new List <UPCRMResultCondition> { this, condition })); }