Hello John,

that't not how you'd usually do this, as executing an operation is more
involved than just calling Execute on it - and it's why several executors
exist in the library.
The idiomatic way to achieve the same is by branching the pipeline in two,
whose entry points would be a updateProductOperation and
addProductOperation. Their implementation would be the same as in your code
except that the first would filter rows by row["ProductAction"] == "Update"
and the second by != "Update".

Hope this helps, Simone

On Sun, Jun 17, 2012 at 6:28 AM, John Strzempa <[email protected]> wrote:

> I want to check the value of a row field value and depending on the value
> run a specific operation. Can this be done. Part of the code is below
>
>     public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
>         {
>             foreach (Row row in rows)
>             {
>                 if (row["ProductAction"] == "Update")
>                 {
>                     _updateProductOperation.Execute(rows);
>                 }
>                 else
>                 {
>                     _addProductOperation.Execute(rows);
>                 }
>
>                 yield return row;
>             }
>         }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino Tools Dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rhino-tools-dev/-/pLnVYjhuzqsJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rhino-tools-dev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to