linq e ef

19

Upload: pietro

Post on 10-May-2015

3.676 views

Category:

Technology


0 download

DESCRIPTION

Slide dell'evento di Perugia su LINQ e ADO.NET Entity Framework

TRANSCRIPT

Page 1: Linq e Ef
Page 2: Linq e Ef

Pietro BrambatiMicrosoftblogs.msdn.com/pietrobr

{ { LINQ LINQ && ADO.NET Entity ADO.NET Entity FrameworkFramework}}

Page 3: Linq e Ef
Page 4: Linq e Ef
Page 5: Linq e Ef
Page 6: Linq e Ef

C# 3.0C# 3.0C# 3.0C# 3.0 VB 9VB 9VB 9VB 9

.NET Language Integrated Query.NET Language Integrated Query

LINQ LINQ toto

ObjeObjectscts

LINQ LINQ toto

ObjeObjectscts

LINQ LINQ toto

DataDataSetsSets

LINQ LINQ toto

DataDataSetsSets

LINQ LINQ toto

SQLSQL

LINQ LINQ toto

SQLSQL

LINQ LINQ toto

XMLXML

LINQ LINQ toto

XMLXML

oggettioggetti

<book> <title/> <author/> <year/> <price/></book>

XMXMLL

Mondo Mondo relazionarelaziona

lele

Page 7: Linq e Ef
Page 8: Linq e Ef

ApplicazionApplicazionee

LINQ to SQLLINQ to SQL

from c in db.Customerswhere c.City == "London"select c.CompanyName

EnumeratEnumeratee

SELECT CompanyNameFROM CustomerWHERE City = 'London'

SQL QuerySQL Queryo SProco SProc

RowsRows

OggettiOggetti

db.Customers.Add(c1);c2.City = “Perugia";db.Customers.Remove(c3);

SubmitChanges()SubmitChanges()

INSERT INTO Customer …UPDATE Customer …DELETE FROM Customer …

DML DML o SProcso SProcs

Page 9: Linq e Ef
Page 10: Linq e Ef

• Dati == Oggetti

• Imperativo Dichiarativo

• Per oggetti, XML e Dati relazionali

Page 11: Linq e Ef
Page 12: Linq e Ef
Page 13: Linq e Ef
Page 14: Linq e Ef
Page 15: Linq e Ef
Page 16: Linq e Ef
Page 17: Linq e Ef
Page 18: Linq e Ef

• LINQ to * : un approccio unificato per l’accesso a sorgenti dati eterogenee

• ADO.NET EF: il modello concettuale per sviluppare… • LINQ to Entites : LINQ per EF• LINQ to SQL e LINQ to Entities sono pensati per diversi

scenari

Page 19: Linq e Ef

© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after

the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Pietro BrambatiMicrosoftblogs.msdn.com/pietrobr