This question is locked. New answers and comments are not allowed.
Hi guys, I have searched for a solution to this but have not yet seen anything that works. I have a static table of tasks that must be completed for a newly submitted request ticket. When the user submits his request, I grab the list, assosicte it with the request id and populate a task completion table. However, i am getting cache errors from my object scope. Here is the code block: public void CreateTaskList(int requestid) |
| { |
| try |
| { |
| //Load the tasks from the static TASKS table |
| var tasks = Load(); |
| //Create a blank TASK COMPLETION record for each task and associate it with //the request id this will be updated as various reviewers complete their //review of the request |
| foreach (var task in tasks) |
| { |
| var asset = new RmoTaskCompletion |
| { |
| RequestId = requestid, |
| TaskId = task.TaskId, |
| Date1 = DateTime.Now, |
| Comments = "", |
| Submitter = "", |
| IsComplete = false, |
| TaskDescription = task.TaskDescription |
| }; |
| if(!_sc.Transaction.IsActive) |
| _sc.Transaction.Begin(); |
| _sc.Add(asset);//Error is thrown here for the second record |
| _sc.Transaction.Commit(); |
| } |
| } |
| catch (Exception ex) |
| { |
| LogManager.LogError(ex); |
| } |
| } |
Thanks. I imagine it is fairly simple, but I can't seem to solve it.
Sean