I have a fairly generic class (Record) that I have added a callback handler to, so I can do something like the following.
record.Save(AfterSaveMethod);
Which also returns the identity number of the record created. The issue I have now is that I have this nested save routine in a loop, and I need to use/pass the i
variable!
for (int i; i < count ;i++)
{
record.Save(AfterSaveMethod2) //but I need to pass i through as well
}
What do I do here?
A\ rewrite the save method and include it in this class (yuk),
B\ have an overloaded save option that takes an object as a parameter, so I can pass it through to my record class, and then merge it with the identity number. Returning both the identity number and anything extra contained in the passed through object (hmm, sounds a bit messy),
C\ is there a sexier option?