1 / 11

Entity Framework

Entity Framework. MIS 324 Professor Sandvig. Outline. What is Entity Framework Benefits Drawbacks Example. What is Entity Framework. Microsoft’s newest data access technology Visual Studio: Examines database Creates objects that represent data schema LINQ (Language Integrated Query)

sema
Download Presentation

Entity Framework

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. Entity Framework MIS 324 Professor Sandvig

  2. Outline • What is Entity Framework • Benefits • Drawbacks • Example

  3. What is Entity Framework • Microsoft’s newest data access technology • Visual Studio: • Examines database • Creates objects that represent data schema • LINQ (Language Integrated Query) • Replaces SQL • Select, sort, filter, etc.

  4. Benefits • Eliminates disconnect between code & database • No sql statements in code • Use intellisense to write query • Automatic table joins • Full CRUD functionality • LINQ works on all data collections • Arrays, lists, dataviews, etc.

  5. Drawbacks • Microsoft propriety technology • LINQ query syntax different than SQL • Better in many ways • Synchronization between database and entity objects • Change database • Rebuild entity objects

  6. Example • Visual Studio: • Create new Dynamic Data Entities Web Site • Add new item: ADO Data Entity Model

  7. Example • Select “Generate from Database” • Select Sql Server database • Express or full version • Note: table relationships MUST be defined in Database Diagram • Wizard creates new Namespace • Contains data objects that match database

  8. Entity Model Designer Window • Note: many-to-many relationship

  9. LINQ • Use LINQ to query against data objects

  10. LINQ Syntax • Vardatatype uses implicit typing • Similar to DataTable

  11. Example • Retail Store Example

More Related