Пример #1
0
        private bool DoesQuestionAlreadyExist(string newQuestion)
        {   //REFACTOR THIS - ONLY DO ONE SERVICE CALL AND HAVE IT RETURN THE WHOLE QUESTION INSTEAD OF THE ID
            //GetHuntQuestions
            List <long> listOfQuestions = serviceClient.GetHuntQuestions(this.currentTreasureHunt).ToList();

            using (var currentHuntQuestionIds = listOfQuestions.GetEnumerator())
            {
                while (currentHuntQuestionIds.MoveNext())
                {
                    question question = serviceClient.GetQuestion(currentHuntQuestionIds.Current);

                    if (String.Equals(question.Question1, newQuestion, StringComparison.OrdinalIgnoreCase))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }