protected void PerformSearch_Click(object sender, EventArgs e) { PageDataCollection pdc = SearchRelations(); PageDataCollection result = new PageDataCollection(); if (!string.IsNullOrEmpty(SearchKeyWord.Text)) { foreach (PageData pd in pdc) { if (pd.PageName.ToLower().Contains(SearchKeyWord.Text.ToString().ToLower())) { result.Add(pd); } } } else { result = pdc; } AllRelations.DataSource = result; AllRelations.DataBind(); }
public bool IsAcquaintedWith(int otherCharacterId) { return(AllRelations.Any(r => r.OtherId == otherCharacterId)); }