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); }
public WizardBL() { _wizardAccessor = new WizardAccessor(); }