Lambda Expressions & Linq

50 %
50 %
Information about Lambda Expressions & Linq
Technology

Published on July 16, 2009

Author: dd.dotnet

Source: slideshare.net

Lambda Expressions & LINQ

Lambda Expressions& LINQ

Lambda Expressions& LINQ& Extension Methods

Lambda Expressions& LINQ& Extension Methods & GenericDelegats

Oliver Guhr

Dresden



Lambda Was sin den nu Lambdas? Lambdas + Events Lambdas + Generics (+ Extensions)

Failcode ownedFeatures.Join(features, of => of, wad => wad, (of, wad) => of)

Failcode ownedFeatures.Join(features, of => of, wad => wad, (of, wad) => of)

Was sind Lambdas? ganz kurz: Lambda Ausdrücke sind anonyme Methoden.

C# 1.0 / 1.1

C# 2.0

C# 3.0

Syntaxbeispiele Einfach: Parameter => Parameter - 5; Komplex: (Parameter1, Parameter2) => { Parameter1.Methode(); Parameter2.Methode(); };

Codebeispiel für Events

Lambdas und generische Listen

Ohne Lambdas:

Mit Lambdas:

Beispiel: List<Person> Personen = new List<Person>(); Personen.Sort(p => p.Alter);

Beispiel: List<Person> Personen = new List<Person>(); Personen.Sort(p => p.Alter); Generic List

Beispiel: List<Person> Personen = new List<Person>(); Personen.Sort(p => p.Alter); Generic List Extension Method

Beispiel: List<Person> Personen = new List<Person>(); Personen.Sort(p => p.Alter); Generic List Extension Method GenericDelegate

Codebeispiele für Extensions

GenericDelegates Fünf Freunde Action, Predicate, Comparison, Converter und Lambdas

Codebeispiele für GenericDelegates

Quellen http://berndhengelein.de/2009/05/funf-freunde-action-predicate-comparison-converter-und-lambda-ausdrucke/ http://www.outofcoffeeexception.de/2008/04/28/LambdaAusdruumlcke+In+C+30.aspx http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx http://msdn.microsoft.com/en-us/library/sx2bwtw7(VS.80).aspx

Vielen Dank :) Mail: oliver.guhr@gmx.de Web: code-inside.de Twitter: twitter.com/oliverguhr Xing: xing.com/profile/Oliver_Guhr

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Lambda Expressions (C# Programming Guide)

Lambda expressions are particularly helpful for writing LINQ query expressions. To create a lambda expression, ...
Read more

MSDN: Lambda-Ausdrücke (C#-Programmierhandbuch)

Lambdas werden in methodenbasierten LINQ-Abfragen als Argumente für ... handelt es sich bei dem Parametertyp um eine System.Linq.Expressions.
Read more

Linq and lambda expression - Stack Overflow

What is the difference between LINQ and Lambda Expressions? Are there any advantages to using lambda instead of linq queries?
Read more

LinQ C# Lambda Expressions Tutorial With Code Example ...

A definite guide for you to understand the LinQ C# lambda expression and start working with it confidently. Feel the do more, write less power of lambda.
Read more

Crashkurs: Lambda Expressions | coders corner

Als ich das erste Mal eine Lambda Expression gesehen habe dachte ich mir: ... Lambda Expressions werden beispielsweise bei der Verwendung von LINQ benötigt.
Read more

c# - Linq query or Lambda expression? - Stack Overflow

Query Expression compiles into Method Expression (Lambda expression), so there shouldn't be any difference, In your code though you are accessing First and ...
Read more

Understand Lambda Expressions in 3 Minutes - CodeProject

Introduction. A lambda expression is an anonymous function and it is mostly used to create delegates in LINQ. Simply put, it's a method without a ...
Read more

Chapter 22. Lambda Expressions and LINQ

Extension Methods. In practice, programmers often have to add new functionality to already existing code. If the code is available, we can simply add the ...
Read more

LINQ - Lambda Expressions - Tutorialspoint

LINQ - Lambda Expressions for Beginners - Learn LINQ (Language Integrated Query) in simple and easy steps starting from its Overview, Standard Query ...
Read more

Grundlagen zu LINQ, λ-Expressions und Extension-Methods

Extension Methods Einführung. Die Extension Methods, oder im Deutschen auch Erweiterungsmethoden genannt, sind eine Spracherweiterung die mit der ...
Read more