entity framework mis 324 mis 324 professor sandvig professor sandvig
TRANSCRIPT
Entity FrameworkEntity Framework
MIS 324MIS 324
Professor SandvigProfessor Sandvig
OutlineOutline
What is Entity FrameworkWhat is Entity Framework BenefitsBenefits DrawbacksDrawbacks ExampleExample
What is Entity FrameworkWhat is Entity Framework
Microsoft’s newest data access Microsoft’s newest data access technologytechnology
Visual Studio:Visual Studio: Examines databaseExamines database Creates objects that represent data schemaCreates objects that represent data schema
LINQ (Language Integrated Query)LINQ (Language Integrated Query) Replaces SQLReplaces SQL Select, sort, filter, etc.Select, sort, filter, etc.
BenefitsBenefits
Eliminates disconnect between code & Eliminates disconnect between code & databasedatabase No sql statements in codeNo sql statements in code
Use intellisense to write queryUse intellisense to write query LINQ works on all data collectionsLINQ works on all data collections
Arrays, lists, dataviews, etc.Arrays, lists, dataviews, etc.
DrawbacksDrawbacks
Microsoft propriety technologyMicrosoft propriety technology LINQ query syntax different than SQLLINQ query syntax different than SQL
Better in many waysBetter in many ways Synchronization between database and Synchronization between database and
entity objects entity objects Change databaseChange database Rebuild entity objectsRebuild entity objects
Creating ModelCreating Model
Creating ModelCreating Model
Creating ModelCreating Model
Creating ModelCreating Model
Note: Relationships should be defined in database
LinqLinq
OutputOutput
Music Store ExampleMusic Store Example