0

My first idea is extend the partial class 'Step' which is an entity. I could add a bool property and then set that true/false as I complete processing on them.. But then every time I regenerate the DBContext after making changes to the DB won't I have to manually keep doing this? OR is some other way.. The code below explains what I am trying to do

    if ((si.StepID == 20) || (si.StepID == 23) || (si.StepID == 24))
                    {
                        //Step is a process. Each Step must be run in order
                        //get list of steps in tasks in RUN (1,2,3,4...) order
                        int stepToRun = 0;
                        var stepsInTask = InstanceExpert.GetAllStepsInTaskOrderedByRunOrder(ti.TaskInstanceID);

                        //Get which step is next to be processed
                        foreach (Step s in stepsInTask)
                        {
                            //get the stepToRun 
                            //Need to extend STEP Entity property with a bool??
                        }

                        //Take that step and run the specific function

                        if (stepToRun == 20)
                        {
                        }

                        if (stepToRun == 23)
                        {
                        }

                        if (stepToRun == 24)
                        {
                        }
punkouter
  • 5,170
  • 15
  • 71
  • 116
  • Does the fact that you've run the process on that step have to be persisted or does it only apply to the current run of the process? – Tony Vitabile May 31 '13 at 18:18
  • Talking to a coworker I think I already have the answer once I have them ordered I should just be able to loop through and and not to persist any information .... But I still wonder if I did need to persist the state of the class when it is a auto generated entity how I would not overwrite my changes... maybe this isn't the most clear question :\ – punkouter May 31 '13 at 18:54
  • I'm not sure exactly what you're asking but by the sounds of it this "register" of items having been processed or not should probably exist outside of the items being processed (single responsibility), unless maybe if the processing of an item actually changes the items internal state. – qujck May 31 '13 at 19:25

0 Answers0