Hi, yesterday we where discussing about saving a many to many relation. To keep the UI and BL seperated, we want to save the M:M in the BL (we use Selfservicing and use HnD as an example). Now we have this situation where we have to save a M:M relationship. In the UI we have a checkboxlist and with every checkbox item comes 2 textboxes. You could see this as an entity.
A user can check multiple checkbox, if he does, he has to fill in the textboxes belonging to this item.
now we want to save and are wondering if we should create a collection in the codebehind of the UI page or we should collect the data, store it in a multi dimensional array and send this array as a parameter to a function in the BL and then save.
Is there any best practice about this issues?
An other point is that these items have to have a FK, but this FK is not created at the moment of saving. Actually, on save, because of dependency, this FK will set because the parent item is inserted first. Am I correct?
Hope anybody can advice.