c# 3.0 e linq
DESCRIPTION
"Microsoft .NET Framework tra presente e futuro", DotNetToscana http://www.dotnettoscana.org/net-presente-futuro.aspxTRANSCRIPT
![Page 1: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/1.jpg)
Microsoft .NET Framework tra presente e futuro
Andrea AngellaDott. in Ingegneria InformaticaEmail: [email protected]: http://blogs.ugidotnet.org/angellaa
![Page 2: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/2.jpg)
Introduzione a LINQ
Rapida rivisitazione di C# 2.0
Nuove caratteristiche di C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
2
![Page 3: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/3.jpg)
3
C# 3.0 VB 9.0 Altri…
.NET Language Integrated Query
LINQ to Objects LINQ to SQL LINQ to Xml LINQ to X
Grafo di oggetti
DatabaseSQL Server
<university><studente /><studente />
</university>
Documento XML
?
![Page 4: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/4.jpg)
4
![Page 5: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/5.jpg)
5
Introduzione a LINQ
Rapida rivisitazione di C# 2.0
Nuove caratteristiche del C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
![Page 6: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/6.jpg)
6
TypeInference
![Page 7: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/7.jpg)
7
![Page 8: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/8.jpg)
8
AnonymousMethod
![Page 9: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/9.jpg)
9
Introduzione a LINQ
Rapida rivisitazione del C# 2.0
Nuove caratteristiche di C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
![Page 10: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/10.jpg)
10
![Page 11: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/11.jpg)
11
![Page 12: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/12.jpg)
12
![Page 13: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/13.jpg)
13
![Page 14: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/14.jpg)
14
![Page 15: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/15.jpg)
15
Lo sviluppatore non conosce il nome del tipo
generato
![Page 16: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/16.jpg)
16
![Page 17: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/17.jpg)
17
Cosa fà questo statement ?
![Page 18: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/18.jpg)
18
![Page 19: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/19.jpg)
19
Local TypeInference
ExtensionMethods Anonymous
Type
Lambda Expression
Object InitializationExpression
![Page 20: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/20.jpg)
20
Introduzione a LINQ
Rapida rivisitazione di C# 2.0
Nuove caratteristiche del C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
![Page 21: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/21.jpg)
21
Extension Methodssu IEnumerable<T>
![Page 22: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/22.jpg)
22
Proiezione: select
Restrizione: where
Ordinamento: orderby
Raggruppamento: group by
Di join: join
Insiemistici: Distinct, Union, Intersect, Except
Aggregazione: Count, Sum, Min, Max, Average, Aggregate
Generazione: Range, Repeat, Empty
Quantificazione: Any, All, Contains
Partizionamento: Take, TakeWhile, Skip, SkipWhile
Elemento: First, Last, Single, ElementAt, DefaultIfEmpty
Conversione: AsEnumerable, ToArray, ToList, ToDictionary, ToLookup, OfType, Cast
Supportati dalle Query Expression
![Page 23: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/23.jpg)
23
Proiezione di una
collection
![Page 24: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/24.jpg)
24
Operatori logici
SubQuery
![Page 25: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/25.jpg)
25
Ordinamento multiplo
![Page 26: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/26.jpg)
26
Campo di raggruppamento
![Page 27: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/27.jpg)
27
![Page 28: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/28.jpg)
28
Operatore di aggregazione
Operatori di partizionamento
![Page 29: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/29.jpg)
29
Modifica della sorgente dati
![Page 30: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/30.jpg)
30
Operatore di conversione
![Page 31: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/31.jpg)
31
![Page 32: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/32.jpg)
32
![Page 33: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/33.jpg)
33
Introduzione a LINQ
Rapida rivisitazione di C# 2.0
Nuove caratteristiche del C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
![Page 34: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/34.jpg)
34
LINQ to SQL
Schema del databaseModello a oggetti
Mapping 1 a 1
![Page 35: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/35.jpg)
35
![Page 36: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/36.jpg)
36
Pensando in SQL (approccio relazionale)◦ Utilizzando operatori di join
Pensando in LINQ (approccio object oriented)◦ Navigando tra le entity sfruttando le relazioni
![Page 37: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/37.jpg)
37
Inserimento
Modifica
Conferma le modifiche
![Page 38: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/38.jpg)
38
Introduzione a LINQ
Rapida rivisitazione di C# 2.0
Nuove caratteristiche del C# 3.0
LINQ to Object
LINQ to SQL
Altre implementazioni di LINQ
Domande e risposte
![Page 39: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/39.jpg)
39
Supportate da Microsoft◦ LINQ to Dataset◦ LINQ to XML◦ LINQ to Entities◦ Parallel LINQ
Supportate dalla community◦ LINQ to Amazon◦ LINQ to Flickr◦ LINQ to Google◦ LINQ to Active Directory◦ LINQ to Lucene◦ LINQ to Excel◦ LINQ to WMI◦ …
![Page 40: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/40.jpg)
40
1. LINQ mi offre un modello uniforme per interrogare qualsiasi sorgente dati
2. LINQ mi permette di scrivere le query con un approccio dichiarativo e naturale
3. LINQ è completamente supportato da VisualStudio 2008 e questo aumenta in maniera eccezionale la mia produttività
4. LINQ to SQL mi offre la possibilità di pensare in modo object-oriented quando interagisto con il database relazione SQL Server
![Page 41: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/41.jpg)
Percorso formativo“LINQ e le novità dei linguaggi .NET”◦ http://msdn.microsoft.com/it-it/vbasic/cc299390.aspx
LINQ Italia◦ http://www.linqitalia.com/
“Programming Microsoft LINQ”◦ Paolo Pialorsi e Marco Russo
◦ Disponibile anche in Italiano
41
![Page 42: C# 3.0 e LINQ](https://reader034.vdocumenti.com/reader034/viewer/2022052304/5598e35a1a28abb17d8b46d7/html5/thumbnails/42.jpg)
Andrea AngellaDott. in Ingegneria InformaticaEmail: [email protected]: http://blogs.ugidotnet.org/angellaa