示例#1
0
        private static IEnumerable<NameObj> ProcessListB()
        {
            int count = 0;

            foreach (string nameB in _namesB)
            {
                NameObj personFromListB = new NameObj()
                {
                    OldName = nameB,
                    NewName = "- " + nameB + " = " + count++.ToString()
                };

                yield return personFromListB;
            }
        }
示例#2
0
        private static IEnumerable <NameObj> ProcessListB()
        {
            int count = 0;

            foreach (string nameB in _namesB)
            {
                NameObj personFromListB = new NameObj()
                {
                    OldName = nameB,
                    NewName = "- " + nameB + " = " + count++.ToString()
                };

                yield return(personFromListB);
            }
        }
示例#3
0
        private static IEnumerable<NameObj> ProcessListA()
        {
            int count = 0;

            foreach (string nameA in _namesA)
            {
                string nameB = String.Empty;

                foreach (NameObj personFromListB in ProcessListB())
                {
                    nameB = personFromListB.NewName;

                    yield return personFromListB;
                }

                NameObj personFromListA = new NameObj()
                {
                    OldName = nameA,
                    NewName = nameA + " = " + count++.ToString()
                };

                yield return personFromListA;
            }
        }
示例#4
0
        private static IEnumerable <NameObj> ProcessListA()
        {
            int count = 0;

            foreach (string nameA in _namesA)
            {
                string nameB = String.Empty;

                foreach (NameObj personFromListB in ProcessListB())
                {
                    nameB = personFromListB.NewName;

                    yield return(personFromListB);
                }

                NameObj personFromListA = new NameObj()
                {
                    OldName = nameA,
                    NewName = nameA + " = " + count++.ToString()
                };

                yield return(personFromListA);
            }
        }