GuidePedia

0
LINQ is a type of query language. A query is a type of expression that retrieves data from a source. Different languages have been developed over time for the various types of data sources, for example SQL for relational databases and XQuery for XML.

linq


LINQ is used in C# (which is a Desktop application development high level language) to retrieve data. It is almost similar to SQL (Structured Query Language), only little bit 
difference in syntax. 


Example of LINQ

 class IntroToLINQ
    {       
        static void Main()
        {
            // The Three Parts of a LINQ Query:
            //  1. Data source.
            int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

            // 2. Query creation.
            // numQuery is an IEnumerable<int>
            var numQuery =
                from num in numbers
                where (num % 2) == 0
                select num;

            // 3. Query execution.
            foreach (int num in numQuery)
            {
                Console.Write("{0,1} ", num);
            }
        }

    }

Here is the list of all functions provided in the downloadable file.

·         Where - Simple 1
·         Where - Simple 2
·         Where - Simple 3
·         Where - Drilldown
·         Where - Indexed
·         Select - Simple 1
·         Select - Simple 2
·         Select - Transformation
·         Select - Anonymous Types 1
·         Select - Anonymous Types 2
·         Select - Anonymous Types 3
·         Select - Indexed
·         Select - Filtered
·         SelectMany - Compound from 1
·         SelectMany - Compound from 2
·         SelectMany - Compound from 3
·         SelectMany - from Assignment
·         SelectMany - Multiple from
·         SelectMany - Indexed
·         Take - Simple
·         Take - Nested
·         Skip - Simple
·         Skip - Nested
·         TakeWhile - Simple
·         TakeWhile - Indexed
·         SkipWhile - Simple
·         SkipWhile - Indexed
·         OrderBy - Simple 1
·         OrderBy - Simple 2
·         OrderBy - Simple 3
·         OrderBy - Comparer
·         OrderByDescending - Simple 1
·         OrderByDescending - Simple 2
·         OrderByDescending - Comparer
·         ThenBy - Simple
·         ThenBy - Comparer
·         ThenByDescending - Simple
·         ThenByDescending - Comparer
·         Reverse
·         GroupBy - Simple 1
·         GroupBy - Simple 2
·         GroupBy - Simple 3
·         GroupBy - Nested
·         GroupBy - Comparer
·         GroupBy - Comparer, Mapped
·         Distinct - 1
·         Distinct - 2
·         Union - 1
·         Union - 2
·         Intersect - 1
·         Intersect - 2
·         Except - 1
·         Except - 2
·         ToArray
·         ToList
·         ToDictionary
·         OfType
·         First - Simple
·         First - Condition
·         FirstOrDefault - Simple
·         FirstOrDefault - Condition
·         ElementAt
·         Range
·         Repeat
·         Any - Simple
·         Any - Grouped
·         All - Simple
·         All - Grouped
·         Count - Simple
·         Count - Conditional
·         Count - Nested
·         Count - Grouped
·         Sum - Simple
·         Sum - Projection
·         Sum - Grouped
·         Min - Simple
·         Min - Projection
·         Min - Grouped
·         Min - Elements
·         Max - Simple
·         Max - Projection
·         Max - Grouped
·         Max - Elements
·         Average - Simple
·         Average - Projection
·         Average - Grouped
·         Aggregate - Simple
·         Aggregate - Seed
·         Concat - 1
·         Concat - 2
·         EqualAll - 1
·         EqualAll - 2
·         Combine
·         Deferred Execution
·         Immediate Execution
·         Query Reuse
·         Cross Join
·         Group Join
·         Cross Join with Group Join
·         Left Outer Join

If you want to know more about LINQ then you can download this file from here and check all the operations and the functions used in LINQ.

Post a Comment

 
Top