--
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 rhino-t...@googlegroups.com.
To unsubscribe from this group, send email to rhino-tools-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
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
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 rhino-tools-dev@googlegroups.com.
To unsubscribe from this group, send email to rhino-tools-dev+unsubscribe@googlegroups.com.