SlideShare ist ein Scribd-Unternehmen logo
1 von 51















    o
    o


    o
    o

    o



    o
var entry = new {                 Dim entry = New With { _
    Title = "Dear Diary",             .Title = "Dear Diary", _
    DateTime.Now                      DateTime.Now _
};                                }

Console.WriteLine("{0:d}: {1}",   Console.WriteLine("{0:d}: {1}", _
    entry.Now, entry.Title);          entry.Now, entry.Title)




var         Dim
                         static                Module
                                                 using Imports

Imports System.Runtime.CompilerServices

Module StringExtensions
    <Extension()> _
    Public Sub Print(ByVal aString As String)
        Console.WriteLine(aString)
    End Sub
End Module

Dim hello = "Hello from StringExtensions"
hello.Print()
                 this
static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
    foreach (T o in source)
        action(o);
}


delegate   void Action();
delegate   void Action<T>(T arg);
delegate   void Action<T1, T2>(T1 arg1, T2 arg2);
delegate   TResult Func<TResult>();
delegate   TResult Func<T, TResult>(T arg);
delegate   TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);

delegate string MyDelegate(int i);

static string MyMethod(int i) { … }
MyDelegate del1 = new MyDelegate(MyMethod);   //   C#   1.0
MyDelegate del2 = delegate(int i) { … };      //   C#   2.0
MyDelegate del3 = MyMethod;                   //   C#   2.0
MyDelegate del4 = (int i) => { … };           //   C#   3.0
Func<int, string> del5 = i => { … };          //   C#   3.0


Dim del4 As MyDelegate = Function(i As Integer) …



Expression<Func<int, int>> inc = (a => a + 1);

ParameterExpression CS$a;
Expression<Func<int, int>> inc =
  Expression.Lambda<Func<int, int>>(
    Expression.Add(
      CS$a = Expression.Parameter(typeof(int), "a"),
      Expression.Constant(1, typeof(int))),
    new ParameterExpression[] { CS$a });

var names = from s in Students
            where s.Age % 2 == 0
            orderby s.Name descending
            select s.Name;



IEnumerable<string> names =
    Students.Where(s => s.Age % 2 == 0)
            .OrderByDescending(s => s.Name)
            .Select(s => s.Name);

    o
    o


    o



    o

    o   

    o   
    o   

    o   

    o
    o   
    o   




    o   

    o   
    o   















    from x1 in e1
    join x2 in e2 on k1 equals k2
    …

    from * in ( e1 ) . Join(
      e2 , x1 => k1 , x2 => k2 , (x1 , x2) => new { x1 , x2 })
    …

    o   this
    o
    o
    o
    o

    o   EqualityComparer<TKey>.Default

    o                Equals()   GetHashcode()
    o

           IEqualityComparer<TKey>
    o
    o
           into
    o
    o   Func<TOuter, TInner, TResult> resultSelector
                   into
    o


    o
    o   Func<TOuter, IEnumerable<TInner>, TResult> resultSelector

    o       DefaultIfEmpty()
        from x1 in e1
        join x2 in e2 on k1 equals k2 into j
        from xj in j . DefaultIfEmpty()
        …
                       from
    o                                  IEnumerable<T>


from x1 in e1
from x2 in e2
…

from * in ( e1 ) . SelectMany(
    x1 => e2 , ( x1 , x2 ) => new { x1 , x2 } )
…
        *
    o


    o                  IEnumerable<T>

    o   yield return

    o
    o
    o
    o

    o
    o


    o
        •   foreach

    o


    o


    o

    o
    o                  IEnumerable<>

    o
    o   EnumerableRowCollection<DataRow>
            AsEnumerable(this DataTable source)
    o   EnumerableRowCollectionExtensions

    o                  Cast<T>()     OfType<T>()
    o                                foreach
        from MyType obj in MyArrayList
        …


    o                   IQueryable<T>


public interface IQueryable   : IEnumerable
{
    Type ElementType { get;   }
    Expression Expression {   get; }
    IQueryProvider Provider   { get; }
}

public interface IQueryable<T> :
    IEnumerable<T>, IQueryable, IEnumerable
{ }



public interface IQueryProvider
{
    IQueryable CreateQuery(Expression expression);
    IQueryable<TElement>
        CreateQuery<TElement>(Expression expression);

    object Execute(Expression expression);
    TResult Execute<TResult>(Expression expression);
}
public static TSource First<TSource>(
                      this IQueryable<TSource> source)
{
  return source.Provider.Execute<TSource>(
    Expression.Call(null,
      ((MethodInfo) MethodBase.GetCurrentMethod())
        .MakeGenericMethod(new Type[] { typeof(TSource) }),
      new Expression[] { source.Expression }
    )
  );
}
   IEnumerable   IQueryable


    o
    o


    o
    o


    o





    o
    o
    o

Weitere ähnliche Inhalte

Was ist angesagt?

Data structure
Data structureData structure
Data structureMarkustec
 
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84Mahmoud Samir Fayed
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentationMartin McBride
 
Closure, Higher-order function in Swift
Closure, Higher-order function in SwiftClosure, Higher-order function in Swift
Closure, Higher-order function in SwiftSeongGyu Jo
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a BossBob Tiernay
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programmingChiwon Song
 
Introduction to JQ
Introduction to JQIntroduction to JQ
Introduction to JQKnoldus Inc.
 
The Ring programming language version 1.9 book - Part 34 of 210
The Ring programming language version 1.9 book - Part 34 of 210The Ring programming language version 1.9 book - Part 34 of 210
The Ring programming language version 1.9 book - Part 34 of 210Mahmoud Samir Fayed
 
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesJava Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesOXUS 20
 
Java Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesJava Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesAbdul Rahman Sherzad
 
Perceptron
PerceptronPerceptron
Perceptronunhas
 
Lecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of TwenteLecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of TwenteDirkjan Bussink
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragmentChiwon Song
 
The Ring programming language version 1.10 book - Part 48 of 212
The Ring programming language version 1.10 book - Part 48 of 212The Ring programming language version 1.10 book - Part 48 of 212
The Ring programming language version 1.10 book - Part 48 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181Mahmoud Samir Fayed
 
20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order functionChiwon Song
 

Was ist angesagt? (19)

Data structure
Data structureData structure
Data structure
 
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.2 book - Part 30 of 84
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentation
 
Closure, Higher-order function in Swift
Closure, Higher-order function in SwiftClosure, Higher-order function in Swift
Closure, Higher-order function in Swift
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a Boss
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programming
 
Introduction to JQ
Introduction to JQIntroduction to JQ
Introduction to JQ
 
The Ring programming language version 1.9 book - Part 34 of 210
The Ring programming language version 1.9 book - Part 34 of 210The Ring programming language version 1.9 book - Part 34 of 210
The Ring programming language version 1.9 book - Part 34 of 210
 
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesJava Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
 
Java Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesJava Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
 
C++ L06-Pointers
C++ L06-PointersC++ L06-Pointers
C++ L06-Pointers
 
Perceptron
PerceptronPerceptron
Perceptron
 
C++ L04-Array+String
C++ L04-Array+StringC++ L04-Array+String
C++ L04-Array+String
 
Clojure functions examples
Clojure functions examplesClojure functions examples
Clojure functions examples
 
Lecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of TwenteLecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of Twente
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragment
 
The Ring programming language version 1.10 book - Part 48 of 212
The Ring programming language version 1.10 book - Part 48 of 212The Ring programming language version 1.10 book - Part 48 of 212
The Ring programming language version 1.10 book - Part 48 of 212
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181
 
20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order function
 

Andere mochten auch

Ngu phap thuong_dung_2
Ngu phap thuong_dung_2Ngu phap thuong_dung_2
Ngu phap thuong_dung_2talabia
 
De thi dai hoc mon hoa (1)
De thi dai hoc mon hoa (1)De thi dai hoc mon hoa (1)
De thi dai hoc mon hoa (1)SEO by MOZ
 
Describe a teacher of the xxi century in a 2
Describe a teacher of the xxi century in a 2Describe a teacher of the xxi century in a 2
Describe a teacher of the xxi century in a 2Juliita
 
Den Perfekte Storm - oplæg for Insead netværksgruppe
Den Perfekte Storm - oplæg for Insead netværksgruppeDen Perfekte Storm - oplæg for Insead netværksgruppe
Den Perfekte Storm - oplæg for Insead netværksgruppePeter Svarre
 
Spanish in Texas: Open learning tools for exploring language diversity
Spanish in Texas: Open learning tools for exploring language diversitySpanish in Texas: Open learning tools for exploring language diversity
Spanish in Texas: Open learning tools for exploring language diversitySpanish in Texas Project
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting PersonalKirsty Hulse
 

Andere mochten auch (8)

Ngu phap thuong_dung_2
Ngu phap thuong_dung_2Ngu phap thuong_dung_2
Ngu phap thuong_dung_2
 
De thi dai hoc mon hoa (1)
De thi dai hoc mon hoa (1)De thi dai hoc mon hoa (1)
De thi dai hoc mon hoa (1)
 
Hoc qua-trai-nghiem
Hoc qua-trai-nghiemHoc qua-trai-nghiem
Hoc qua-trai-nghiem
 
Describe a teacher of the xxi century in a 2
Describe a teacher of the xxi century in a 2Describe a teacher of the xxi century in a 2
Describe a teacher of the xxi century in a 2
 
My moviesssss
My moviesssssMy moviesssss
My moviesssss
 
Den Perfekte Storm - oplæg for Insead netværksgruppe
Den Perfekte Storm - oplæg for Insead netværksgruppeDen Perfekte Storm - oplæg for Insead netværksgruppe
Den Perfekte Storm - oplæg for Insead netværksgruppe
 
Spanish in Texas: Open learning tools for exploring language diversity
Spanish in Texas: Open learning tools for exploring language diversitySpanish in Texas: Open learning tools for exploring language diversity
Spanish in Texas: Open learning tools for exploring language diversity
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 

Ähnlich wie LINQ Internals - STLDODN

Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsChris Eargle
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Codemotion
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with GroovyArturo Herrero
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
 
c++ Lecture 4
c++ Lecture 4c++ Lecture 4
c++ Lecture 4sajidpk92
 
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAMPROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parserkamaelian
 
The underestimated power of KeyPaths
The underestimated power of KeyPathsThe underestimated power of KeyPaths
The underestimated power of KeyPathsVincent Pradeilles
 
Hello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdfHello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdfFashionColZone
 
how to reuse code
how to reuse codehow to reuse code
how to reuse codejleed1
 
Round PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallyRound PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallySean Cribbs
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyasrsnarayanan
 

Ähnlich wie LINQ Internals - STLDODN (20)

C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
 
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query ExpressionsMonadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
 
C sharp 8
C sharp 8C sharp 8
C sharp 8
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
C++ TUTORIAL 4
C++ TUTORIAL 4C++ TUTORIAL 4
C++ TUTORIAL 4
 
I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
 
c++ Lecture 4
c++ Lecture 4c++ Lecture 4
c++ Lecture 4
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
lesson 2.pptx
lesson 2.pptxlesson 2.pptx
lesson 2.pptx
 
C++ practical
C++ practicalC++ practical
C++ practical
 
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAMPROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS  - SARASWATHI RAMALINGAM
PROGRAMMING IN C EXAMPLE PROGRAMS FOR NEW LEARNERS - SARASWATHI RAMALINGAM
 
SWP - A Generic Language Parser
SWP - A Generic Language ParserSWP - A Generic Language Parser
SWP - A Generic Language Parser
 
The underestimated power of KeyPaths
The underestimated power of KeyPathsThe underestimated power of KeyPaths
The underestimated power of KeyPaths
 
Hello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdfHello, I need some assistance in writing a java program THAT MUST US.pdf
Hello, I need some assistance in writing a java program THAT MUST US.pdf
 
DataTypes.ppt
DataTypes.pptDataTypes.ppt
DataTypes.ppt
 
how to reuse code
how to reuse codehow to reuse code
how to reuse code
 
Round PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing FunctionallyRound PEG, Round Hole - Parsing Functionally
Round PEG, Round Hole - Parsing Functionally
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
 

Kürzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

LINQ Internals - STLDODN

  • 1.
  • 4.   o o  o o
  • 5. o   o
  • 6. var entry = new { Dim entry = New With { _ Title = "Dear Diary", .Title = "Dear Diary", _ DateTime.Now DateTime.Now _ }; } Console.WriteLine("{0:d}: {1}", Console.WriteLine("{0:d}: {1}", _ entry.Now, entry.Title); entry.Now, entry.Title) var Dim
  • 7. static Module  using Imports  Imports System.Runtime.CompilerServices Module StringExtensions <Extension()> _ Public Sub Print(ByVal aString As String) Console.WriteLine(aString) End Sub End Module Dim hello = "Hello from StringExtensions" hello.Print()
  • 8. this static void ForEach<T>(this IEnumerable<T> source, Action<T> action) { foreach (T o in source) action(o); }  delegate void Action(); delegate void Action<T>(T arg); delegate void Action<T1, T2>(T1 arg1, T2 arg2); delegate TResult Func<TResult>(); delegate TResult Func<T, TResult>(T arg); delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);
  • 9.  delegate string MyDelegate(int i); static string MyMethod(int i) { … } MyDelegate del1 = new MyDelegate(MyMethod); // C# 1.0 MyDelegate del2 = delegate(int i) { … }; // C# 2.0 MyDelegate del3 = MyMethod; // C# 2.0 MyDelegate del4 = (int i) => { … }; // C# 3.0 Func<int, string> del5 = i => { … }; // C# 3.0  Dim del4 As MyDelegate = Function(i As Integer) …
  • 10.    Expression<Func<int, int>> inc = (a => a + 1);  ParameterExpression CS$a; Expression<Func<int, int>> inc = Expression.Lambda<Func<int, int>>( Expression.Add( CS$a = Expression.Parameter(typeof(int), "a"), Expression.Constant(1, typeof(int))), new ParameterExpression[] { CS$a });
  • 11.  var names = from s in Students where s.Age % 2 == 0 orderby s.Name descending select s.Name;  IEnumerable<string> names = Students.Where(s => s.Age % 2 == 0) .OrderByDescending(s => s.Name) .Select(s => s.Name);
  • 12. o o  o  o
  • 13. o   o  o   o   o o  o   o   o  o 
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34. from x1 in e1 join x2 in e2 on k1 equals k2 …  from * in ( e1 ) . Join( e2 , x1 => k1 , x2 => k2 , (x1 , x2) => new { x1 , x2 }) …  o this o o o o
  • 35. o EqualityComparer<TKey>.Default  o Equals() GetHashcode() o  IEqualityComparer<TKey> o o
  • 36.
  • 37. into o o Func<TOuter, TInner, TResult> resultSelector  into o o o Func<TOuter, IEnumerable<TInner>, TResult> resultSelector  o DefaultIfEmpty() from x1 in e1 join x2 in e2 on k1 equals k2 into j from xj in j . DefaultIfEmpty() …
  • 38. from o IEnumerable<T>  from x1 in e1 from x2 in e2 …  from * in ( e1 ) . SelectMany( x1 => e2 , ( x1 , x2 ) => new { x1 , x2 } ) …  * o
  • 39.   o IEnumerable<T>  o yield return  o o o o
  • 40. o o  o • foreach o  o  o
  • 41.
  • 42.
  • 43.
  • 44. o o IEnumerable<>  o o EnumerableRowCollection<DataRow> AsEnumerable(this DataTable source) o EnumerableRowCollectionExtensions  o Cast<T>() OfType<T>() o foreach from MyType obj in MyArrayList …
  • 45.
  • 46.   o IQueryable<T> public interface IQueryable : IEnumerable { Type ElementType { get; } Expression Expression { get; } IQueryProvider Provider { get; } } public interface IQueryable<T> : IEnumerable<T>, IQueryable, IEnumerable { }
  • 47.  public interface IQueryProvider { IQueryable CreateQuery(Expression expression); IQueryable<TElement> CreateQuery<TElement>(Expression expression); object Execute(Expression expression); TResult Execute<TResult>(Expression expression); }
  • 48. public static TSource First<TSource>( this IQueryable<TSource> source) { return source.Provider.Execute<TSource>( Expression.Call(null, ((MethodInfo) MethodBase.GetCurrentMethod()) .MakeGenericMethod(new Type[] { typeof(TSource) }), new Expression[] { source.Expression } ) ); }
  • 49.
  • 50. IEnumerable IQueryable   o o  o o
  • 51.   o  o o o