1 / 25

ADO.NET Entity Framework { LINQ und Konsorten }

ADO.NET Entity Framework { LINQ und Konsorten }. Dariusz Parys Developer Evangelist Microsoft Deutschland GmbH. Agenda. Warum LINQ? LINQ to … Was es so alles gibt Einführung ADO.NET Entity Framework Abfragen von Daten Modifizieren von Daten Concurrency Transaktionen

bijan
Télécharger la présentation

ADO.NET Entity Framework { LINQ und Konsorten }

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ADO.NET Entity Framework{LINQ und Konsorten} Dariusz Parys Developer Evangelist Microsoft Deutschland GmbH

  2. Agenda • Warum LINQ? • LINQ to… • Was es so alles gibt • Einführung ADO.NET Entity Framework • Abfragen von Daten • Modifizieren von Daten • Concurrency • Transaktionen • StoredProcedures • Zusammenfassung

  3. Datenzugriffbisher…

  4. <book> <title/> <author/> <year/> <price/> </book> Relational Objects XML Das LINQ Projekt .NET Language Integrated Query C# 3.0 Visual Basic 9.0 Others LINQ toObjects LINQ toDataSets LINQ toSQL LINQ toEntities LINQ toXML

  5. {LINQ to …} demo Dariusz Parys Developer Evangelist D&PE

  6. ADO.NET Entity Framework V3.0 ORM & LINQ .NET Provider (EntitySQL) Conceptual Model Mapping V2.0 .NET Provider Store SQL Server DB/2 Oracle Weitere

  7. LINQ to Entities vs. LINQ to SQL • Schema unabhängig • Datenbankunabhängig • HöhereAbstraktion • SSDL, CSDL, C-S Map • Mehr Design-Möglichkeiten • Table-Inheritance • Assoziationen • Nicht in VS 2008 • Momentan Beta 3 • Einfach zu nutzen • Client / Server Anwendungen • Nur SQL Server • Direktes Mapping von Schema auf Klassen • Verfügbar in VS 2008 LINQ to Entities LINQ to SQL

  8. LINQ to Entities • API in folgenden Assemblies implementiert • System.Data.Entity.dll • System.Data.Entity.Design.dll • EineReihe von neuen Namespaces • System.Data.Entity • System.Data.Objects • Und vielemehr... • Stand derDinge • Entity Framework Runtime Beta 3 • Entity Framework Tools CTP 2

  9. {Entity Modell erstellen} demo Dariusz Parys Developer Evangelist D&PE

  10. ÜberblickObjectContext & Co. provider Connection Metadata CSDL MSL SSDL State Management CRUD

  11. {Daten abfragen } demo Dariusz Parys Developer Evangelist D&PE

  12. {Daten modifizieren } demo Dariusz Parys Developer Evangelist D&PE

  13. Überschreiben? Exception? Concurrency col1 col2 col3 col4 SaveChanges() 1 A B C entity col1 col2 col3 col4 1 A B C X Y Original Current col1 col1 col2 col2 col3 col3 col4 col4 X 1 1 A A B B C C

  14. {Concurrency} demo Dariusz Parys Developer Evangelist D&PE

  15. Transaktionen • Möglichkeiten • SaveChanges() ErstellteineTransaktion • TransactionScopeKlammer um Operationen SaveChanges()

  16. {Transaktionen } demo Dariusz Parys Developer Evangelist D&PE

  17. Stored Procedures • Stored procedures • Kontrolle • Sicherheit • Performance? • LINQ to Entities kann Stored Procedures nutzen

  18. {StoredProcedures} demo Dariusz Parys Developer Evangelist D&PE

  19. WeiterewichtigeDinge... • MitmehrerenObjectContextObjektenarbeiten • Hooks imgenerierten Code • EigenesDomänenmodellintegrieren • Ableitungen • Metadaten

  20. MehrereObjectContextObjekte • Manchmalbenötigt man mehrere... detach entity 1 entity 1 entity 1 entity 2 entity 2 entity 2 entity N entity N entity N Web Farm query Server 1 serialize get Server 2 update attach client update

  21. Zusammenfassung • Lernen Sie mit LINQ umzugehen • LINQ to SQL • Pragmatischer Client/Server Ansatz • Nur SQL Server • LINQ toEntities • Volle Flexibilität • Datenbankunabhängig

  22. Kontakt: Dariusz Parys • Mein Blog: • http://blogs.msdn.com/dparys • Meine Email: • dparys@microsoft.com

  23. Visual Studio 2008weitere Angebote • Visual Studio Team System Information Day • Regelmäßige ganztägige Informationsveranstaltung von Microsoft • Praxisnahe Demos & viel Raum für Diskussionen • Details & Anmeldung: www.event-team.com/events/visualstudio • TeamConf 2008 – Die Visual Studio Team System Konferenz • VSTS in der Praxis - 22.-24. April 2008 in München • Anwenderberichte (Siemens, ABB, Commerzbank, Datev, Münchener Rück,..) • Fach- und Technologievorträge • Vortragsprogramm und Anmeldung: www.teamconf.de • Visual Studio Launch Promotion • Tauschen Sie Ihre Visual Studio Standard in eine höherwertige Visual Studio Edition Ihrer Wahl • Anrechnung in Höhe von 299 € beim Kauf eines anderen VS Produktes • vom 19. Februar bis zum 30. April 2008 • Nur bei den Partnern: PC Ware, SoftExpress, SOS und Zoschke(befinden sich alle in der Ausstellerhalle)

  24. AsktheExperts Wir freuen uns auf Ihre Fragen: Technische Experten stehen Ihnen während der gesamten Veranstaltung in der Haupthalle zur Verfügung.

  25. © 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.

More Related