Пример #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");
 }
Пример #2
0
        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");
        }