Hooked on LINQ

Hooked on LINQ - Developers' Wiki
for .NET Language Integrated Query

Quick Search

Advanced Search »
{TOC}
Namespace:System.Linq
Assembly:System.Core.dll
Extends:IEnumerable<T>

Back to Standard Query Operator Index


Edit

Introduction

The Concat operator concatenates two sequences. It returns all elements from the first sequence, then all elements from the second sequence. If you want duplicate elements returned, consider using the Union operator instead.

Edit

Method Signatures

public static IEnumerable<TSource> Concat<TSource>(
    this IEnumerable<TSource> first, 
    IEnumerable<TSource> second)



Edit

Exceptions

Throws an ArgumentNullException if first or second is null.

Edit

Pseudo-code

If first is null, throw an ArgumentNullException.
If second is null, throw an ArgumentNullException.
Iterate the first sequence.
Return the current element (Resume execution from here when the next element is requested).
Iterate the second sequence.
Return the current element (Resume execution from here when the next element is requested).

Edit

Loop Count

This operator implements the standard deferred execution iterator pattern. This means, no looping will occur until the result is iterated over.

Edit

Code Samples

TODO:Needs code sample.

If you would like to comment on this page, click on the Discuss button located on the top-right of each page. Feel free to edit any mistakes or omissions you find. If you have an objection or find in-appropriate content then contact the administrator. This website is not affiliated with Microsoft®, all content and opinions are those of the specific author and some advice, solutions and article may contain unintentional errors - please use care. Powered by ScrewTurn Wiki version 2.0.33. Some of the icons created by FamFamFam.