Hi, I'm trying out RhinoETL and I'm having some issues in trying to wrap my
head around how the EventRaisingEnumerator is used.Specifically, I want to
log the numbers of row processed during the operation, and I'm trying to do
so with this code:

public DeleteData(string connectionStringName) : base(connectionStringName)
        {
            OnRowProcessed += delegate
                {
                    rowsDeleted++;
                });
            OnFinishedProcessing += op =>
                {
                    Info("Rows deleted: {0}", rowsDeleted);
                };
        }

where DeleteData inherits from OutputCommandOperation. With the code that's
on the trunk only the OnFinishedProcessingEvent is raised, therefore 0 is
always logged, printing this out:

Committing DeleteData
Committed DeleteData
Rows deleted: 0

I tried by modifying the OutputCommandOperation class by wrapping the rows
in the Execute method in an EventRaisingEnumerator, but doing so I get this:

Rows deleted: x
Committing DeleteData
Committed DeleteData
Rows deleted: x

Ideally, I'd want the Rows deleted message once after the commit message,
but I think this might be tricky, since I guess the processing is already
wrapped in an EventRaisingEnumerable, just not in the point I would like it.

--~--~---------~--~----~------------~-------~--~----~
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