当前位置: 首页>>代码示例>>C#>>正文


C# Collection.Append方法代码示例

本文整理汇总了C#中Collection.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Collection.Append方法的具体用法?C# Collection.Append怎么用?C# Collection.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Collection的用法示例。


在下文中一共展示了Collection.Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Search

        public Collection<Candidate> Search()
        {
            IEnumerable<Candidate> filteredCandidates = Get.Where(c => c.Id > 0); // Our results collection
            Collection<Candidate> results = new Collection<Candidate>();

            // If we have a basic search
            if (Basic != null)
            {
                filteredCandidates = filteredCandidates.Where(
                    c => c.Forename.ParseText(Basic.Query)
                        || c.Surname.ParseText(Basic.Query)
                        );

                // Select only the active clients
                if (Basic.ShowActive)
                    results.Append(filteredCandidates.Where(c => c.Active));

                // Select only the inactive clients
                if (Basic.ShowInactive)
                    results.Append(filteredCandidates.Where(c => !c.Active));
            }

            if (Advanced != null)
            {
                filteredCandidates = GetCandidatesByName(filteredCandidates);
                filteredCandidates = GetCandidatesByAddress(filteredCandidates);
                filteredCandidates = GetCandidatesByExperience(filteredCandidates, ExperienceType.Skill);
                filteredCandidates = GetCandidatesByExperience(filteredCandidates, ExperienceType.Work);
                filteredCandidates = GetCandidatesBySalary(filteredCandidates);
                filteredCandidates = GetFiltered(filteredCandidates);

                results.Append(filteredCandidates);
            }

            return results.RemoveDuplicates(); // Remove any duplicates and return our result set
        }
开发者ID:r3plica,项目名称:Boomerang,代码行数:36,代码来源:CandidateResults.cs

示例2: Search

        public IEnumerable<Client> Search()
        {
            IEnumerable<Client> filteredClients = Get.Where(c => c.Id > 0); // Our results collection
            Collection<Client> results = new Collection<Client>();

            // If we have a basic search
            if (Basic != null)
            {
                filteredClients = filteredClients.Where(
                    c => c.Name.ParseText(Basic.Query)
                        || c.PrimaryContact().Forename.ParseText(Basic.Query)
                        || c.PrimaryContact().Surname.ParseText(Basic.Query)
                        );

                // Select only the active clients
                if (Basic.ShowActive)
                    results.Append(filteredClients.Where(c => c.Active));

                // Select only the inactive clients
                if (Basic.ShowInactive)
                    results.Append(filteredClients.Where(c => !c.Active));
            }

            // If we have an advanced search
            if (Advanced != null)
            {
                filteredClients = GetClientsByName(filteredClients);
                filteredClients = GetClientsByAddress(filteredClients);
                filteredClients = GetClientsByContact(filteredClients);
                filteredClients = GetClientsBySector(filteredClients);

                results.Append(filteredClients);
            }

            return results.RemoveDuplicates(); // Remove any duplicates and return our result set
        }
开发者ID:r3plica,项目名称:Boomerang,代码行数:36,代码来源:ClientResults.cs


注:本文中的Collection.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。