How to separate business logic from code?
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
How to take this code to stored procedure for one transaction
string descriptionForChildTable = "a,b,c,d,e" string[] arrDescriptionForChildTable = descriptionForChildTable.Split(','); int id = AddRecordToParentTable(); if(id > 0) { for(int i=0; i < descriptionForChildTable.Length; i++) { string description = descriptionForChildTable[i]; AddRecordToChildTable(description, id); } }
As you guys know, it should be executed all in one or none, in stored procedure. Hope made some sense above.