本文整理汇总了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
}
示例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
}