コード例 #1
0
        private SearchResultGroup GetOrCreateGroup(string title)
        {
            if (this.SearchResultGroups == null)
                this.SearchResultGroups = new List<SearchResultGroup>();

            SearchResultGroup group = (from g in this.SearchResultGroups
                                      where g.Title == title
                                      select g).FirstOrDefault();

            if (group == null)
            {
                group = new SearchResultGroup { Title = title };
                this.SearchResultGroups.Add(group);
            }

            return group;
        }
コード例 #2
0
        private SearchResultGroup GetOrCreateGroup(string title)
        {
            if (this.SearchResultGroups == null)
            {
                this.SearchResultGroups = new List <SearchResultGroup>();
            }

            SearchResultGroup group = (from g in this.SearchResultGroups
                                       where g.Title == title
                                       select g).FirstOrDefault();

            if (group == null)
            {
                group = new SearchResultGroup {
                    Title = title
                };
                this.SearchResultGroups.Add(group);
            }

            return(group);
        }