示例#1
0
 public void ICollectionOptimization()
 {
     var source = new NonEnumerableCollection<string> { "hello", "there" };
     // If ToList just iterated over the list, this would throw
     var list = source.ToList();
     list.AssertSequenceEqual("hello", "there");
 }
        public void ICollectionOptimized()
        {
            var source = new NonEnumerableCollection <string> {
                "hello", "there"
            };
            var list = source.ToList();

            list.AssertSequenceEqual("hello", "there");
        }
示例#3
0
        public void CollectionOptimization()
        {
            var source = new NonEnumerableCollection <string> {
                "One", "Two"
            };
            var result = source.ToList();

            result.AssertSequenceEqual("One", "Two");
        }
示例#4
0
        public void ICollectionOptimization()
        {
            var source = new NonEnumerableCollection <string> {
                "hello", "there"
            };
            // If ToList just iterated over the list, this would throw
            var list = source.ToList();

            list.AssertSequenceEqual("hello", "there");
        }