private void BuildConditionModel(ConditionType conditionType) { var model = new ConditionModel { Type = conditionType }; while (_stack.Count > 0) { model.Groups.Add((ComparisonGroup)_stack.Pop()); } model.Groups.Reverse(); _stack.Push(model); }