SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Dernier (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

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