- Edited
I am afraid that I will have to rethink my design for the gift batch validation. However, I wanted to check to be sure.
In order to create the Gift Batch Import validation routines, I was planning to add a helper object, CSV Parser, for the existing gift import. The division of responsibility that I envisioned was that the ImportGiftBatches method would continue to manage files and database interactions. It would retrieve a single record from the CSV import file and call the appropriate method in CSV Parser. CSV Parser would receive the CSV record, parse it, and return a "free-standing" table row (or rows, in the case of gift/gift detail) along with a Verification Result Collection of any parsing errors. ImportGiftBatches would then call the existing validation framework to complete the verification of the returned row. If edits were passed, it would then apply the appropriate key to the row and insert it into the database.
The benefit that I saw with this structure was that it seemed very clean from a testing point of view. Because each component would have minimal interdepency, unit test requirements could be more clearly envisioned and setup would be minimized.
Is it possible with the current data set objects and methods to create independent table rows? And later put them into the connected dataset and update the database? I am now thinking that my plan won't work because it is only possible to create gift batch batch, gift and detail rows which are included in a dataset actively linked to the database. Is that correct?