C# has a yield keyword the best description I could find is available  here.  Basically it allows you to write a custom iterator.
Given this code:
public static class GalaxyClass
{
    public static void ShowGalaxies()
    {
        var theGalaxies = new Galaxies();
        foreach (Galaxy theGalaxy in theGalaxies.NextGalaxy)
        {
            Debug.WriteLine(theGalaxy.Name + " " + theGalaxy.MegaLightYears.ToString());
        }
    }
    public class Galaxies
    {
        public System.Collections.Generic.IEnumerable NextGalaxy
        {
            get
            {
                yield return new Galaxy { Name = "Tadpole", MegaLightYears = 400 };
                yield return new Galaxy { Name = "Pinwheel", MegaLightYears = 25 };
                yield return new Galaxy { Name = "Milky Way", MegaLightYears = 0 };
                yield return new Galaxy { Name = "Andromeda", MegaLightYears = 3 };
            }
        }
    }
    public class Galaxy
    {
        public String Name { get; set; }
        public int MegaLightYears { get; set; }
    }
}
 If we run this we will see:
Tadpole Pinwheel Milky Way Andromeda
Basically it will return one at a time each time MoveNext is called via the foreach.
Something to keep in mind, once you use yield in a method you don't need to check for an empty collection it will just return an empty collection.
        static IEnumerable GetDates(DateTime[] dates)
        {
            foreach (var date in dates)
            {
                yield return date;
            }
        }
 
If our collection in our foreach is null it will throw an exception.  Can we work around it?
This can be done like so:
        static IEnumerable GetDates(DateTime[] dates)
        {
            if (!dates.Any())
            {
                // This basically stops execution like an empty collection
                yield break;
            }
            // So we don't get an exception in the foreach
            foreach (var date in dates)
            {
                yield return date;
            }
        }
 Let's say given some dates we might want the minimum date, but if there are no dates use 1/1/1980. If we have no dates like so:
            var dates = new DateTime[] { };
            var min = dates.Min();
		var dates = new DateTime[] { };
		var min = GetDates(dates).Min();
		
		...
			
        static IEnumerable GetDates(DateTime[] dates)
        {
            if (!dates.Any())
            {
                yield return new DateTime(1980, 1, 1);
                yield break; //Read below this is IMPORTANT!
            }
            // So we don't get an exception in the foreach
            foreach (var date in dates)
            {
                yield return date;
            }
        }			
 The text book example for yield is lazy loading. Here is some sample reader code:
            var result = new List();
            //Command is a DbCommand
            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    result.Add(LoadDog(reader));
                }
            }
            return result;
 var chompers = result.FirstOrDefault(o => o.Name.Equals("Chompers"));
Let's change it to use yield and see if we can read them one at a time until we find what we are looking for.
            var result = new List();
            //Command is a DbCommand
            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    yield return LoadDog(reader);
                }
            }
 This is especially useful for lazy loading of children on an object. If we had an owner class and a collection of dogs, we could make the get on the Dogs property lazy load by using the yield keyword. We won't need a backing variable and have to load the dogs into it, we can only call the database when we access the Dogs property and we only deal with it one at a time.
Yield allows you to write custom iterators. There are pitfalls and you should make yourself familiar with yield before abusing it. Think if you are using the entire collection, should you use yield?