/// <summary> /// Execute the pipeline /// </summary> /// <param name="observed">observed operation</param> /// <param name="throwOnError">Throw exception on error</param> /// <returns>List of row resulting from the pipeline</returns> public static EtlFullResult Execute(this IObservableOperation observed, bool throwOnError) { RecordOperation record = new RecordOperation(); observed.Subscribe(record); record.Start(); if (record.Result.CountExceptions > 0 && throwOnError) { throw new EtlResultException(record.Result, "Pipeline error", record.Result.Exceptions.FirstOrDefault()); } return record.Result; }
private void CheckOperation() { if (_recorded == null) { // To save memory, if the last operation is a record, we do not create a new one. if (Operation is RecordOperation) { _recorded = (RecordOperation)Operation; } else { _recorded = Operation.Record(); } _recorded.Start(); } }