コード例 #1
0
 private bool TestCaseContainsStep(TestCase tc, int id)
 {
     foreach (var step in tc.Steps)
     {
         if (step.StepId == id) return true;
     }
     return false;
 }
コード例 #2
0
        private void DeleteRemovedSteps(TestCase tc, string[] stepsID)
        {
            List<int> stepToRemove = new List<int>();
            foreach (var step in tc.Steps)
            {
                if (!stepsID.Contains(step.StepId.ToString()))
                {
                    stepToRemove.Add(step.StepId);
                }
            }

            foreach (var item in stepToRemove)
            {
                Step step = db.Steps.Find(item);
                db.Steps.Remove(step);
                db.SaveChanges();
            }
        }