Пример #1
0
            public List <Answer> GetAllModels()
            {
                List <Answer> answers   = new List <Answer>();
                var           restricts = DeserializeAnswers.FromJson(Json);

                foreach (var restrict in restricts.ContentList)
                {
                    Answer answer = new Answer
                    {
                        Value = restrict.Caption.Trim(),
                        Key   = Regex.Match(restrict.Url, @"restriction1=(.*?)&").Groups[1].Value
                    };
                    answers.Add(answer);
                }
                return(answers);
            }
Пример #2
0
            public List <Answer> GetAllModels()
            {
                if (Json == null)
                {
                    return(null);
                }

                List <Answer> answers = new List <Answer>();
                var           years   = DeserializeAnswers.FromJson(Json);

                foreach (var year in years.ContentList)
                {
                    Answer answer = new Answer
                    {
                        Value = year.Caption,
                        Key   = year.Caption
                    };
                    answers.Add(answer);
                }
                return(answers);
            }