Exemplo n.º 1
0
        public WizardVO FindById(int problemId)
        {
            WizardVO wizard = new WizardVO();

            using (var wizardAccessor = new WizardAccessor())
            {
                wizard.Problem = wizardAccessor.RepoProblem.Find(problemId);

                if (wizard.Problem != null && wizard.Problem.ProblemID > 0)
                {
                    List<SolutionVO> solutions = wizard.Problem.Solutions.ToList();

                    if (solutions != null && solutions.Count > 0)
                    {
                        SolutionVO solution = solutions.FirstOrDefault();
                        wizard.Solution = solution;

                        if (wizard.Solution.Steps != null && wizard.Solution.Steps.Count > 0)
                        {
                            wizard.Steps = new ObservableCollection<StepVO>(wizard.Solution.Steps);
                        }
                    }

                }
            }

            return wizard;
        }
Exemplo n.º 2
0
 public WizardBL()
 {
     _wizardAccessor = new WizardAccessor();
 }