IEnumerable <HashSet <string> > RelationEntity() { Func <string, bool> Is_ItemName = (string x) => (ah_map.ContainsKey(x)); foreach (var set in alu.Entity()) { if (set.Count >= 2 && Is_ItemName(set.ElementAt(0))) { yield return(set); } } }
IEnumerable <HashSet <string> > RelationEntity() { Func <string, bool> Is_ItemName = (string x) => (x.StartsWith("Item.Name2.")); Func <string, string> Raw_toAlias = (string x) => (x.Substring(11)); foreach (var set in alu.Entity()) { if (set.Count == 2 && Is_ItemName(set.ElementAt(0)) && set.ElementAt(1) != "") { var result = new HashSet <string>(); result.Add(Raw_toAlias(set.ElementAt(0))); result.Add(set.ElementAt(1)); yield return(result); } } }