SlideShare une entreprise Scribd logo
1  sur  12
Sql data access (Classic style)

          SQL String: «SELECT x, y FROM TblPoints»


     Entity Framework
Sql data access with EF
   Entity Framework
    takes care of the
    DB interactions
    and makes it
    easy to access
    relational data.
                        LINQ               «SQL»

                                  Entity
                               Framework
What is the Model?

   Farm Model
                            Farm
                     Pig
                     s

                                     Ducks


                           Rabbits
Database

                  Farm
           Pig
           s
Farm DB
                         Duck
                         s

                 Rabb
                 its
Entity Framework model
                 Our software




                                       Farm
                                Pig
                                s

                                              Duck
                                              s
    Farm Model   Farm DB
                                      Rabb
                                      its
EF Model

     Database-First
                        Farm DB     Farm Model




     Code-first
                       Farm Model   Farm DB
EF –DB first
   DB First
     When you have a ready DB
       and you want to access the
       existing data
     If you better prefer to build
       the database first, and
       automatically create the
       model
EF –DB first
   Demo:
    › Create a DB
    › Import it in into Visual Studio
    › See what has been generated
       EDMX
       Mappings
       C#
       Class diagram
EF –Model first
   Model First
    › When you are building a new
      solution from scratch
      (New approach)
EF –Model first
   Demo...
    › Create the model
    › Create an empty DB
    › Generate the DB schema
EF –Model first
    Demo
     › Reference the Entity solution in a
       separate project
        Add reference
        Copy the connection string
        Reference System.Data.Entity
     › Query data with LINQ
          Select
          Update
          Insert
          Delete

Contenu connexe

Similaire à EESTEC Summer School 2012 - Entity Framework - Erni Durdevic

ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
Doncho Minkov
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
manisoft84
 

Similaire à EESTEC Summer School 2012 - Entity Framework - Erni Durdevic (20)

Using entity framework core in .net
Using entity framework core in .netUsing entity framework core in .net
Using entity framework core in .net
 
ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
Clojure at BackType
Clojure at BackTypeClojure at BackType
Clojure at BackType
 
Applying EF Code First at Your Job
Applying EF Code First at Your JobApplying EF Code First at Your Job
Applying EF Code First at Your Job
 
EMF-IncQuery 0.7 Presentation for Itemis
EMF-IncQuery 0.7 Presentation for ItemisEMF-IncQuery 0.7 Presentation for Itemis
EMF-IncQuery 0.7 Presentation for Itemis
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Ef code first
Ef code firstEf code first
Ef code first
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
 
Entity framework
Entity frameworkEntity framework
Entity framework
 
From UML Profiles to EMF Profiles and Beyond (TOOLS'11)
From UML Profiles to EMF Profiles and Beyond (TOOLS'11)From UML Profiles to EMF Profiles and Beyond (TOOLS'11)
From UML Profiles to EMF Profiles and Beyond (TOOLS'11)
 
Ta3
Ta3Ta3
Ta3
 
Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...
 
Rapidly Building Data Driven Web Pages with Dynamic ADO.NET
Rapidly Building Data Driven Web Pages with Dynamic ADO.NETRapidly Building Data Driven Web Pages with Dynamic ADO.NET
Rapidly Building Data Driven Web Pages with Dynamic ADO.NET
 
Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)Entity Framework - Entity Data Model (edm)
Entity Framework - Entity Data Model (edm)
 
Scaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure FederationsScaling with SQL Server and SQL Azure Federations
Scaling with SQL Server and SQL Azure Federations
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13
 
JavaOne 2012 - CON11234 - Multi device Content Display and a Smart Use of Ann...
JavaOne 2012 - CON11234 - Multi device Content Display and a Smart Use of Ann...JavaOne 2012 - CON11234 - Multi device Content Display and a Smart Use of Ann...
JavaOne 2012 - CON11234 - Multi device Content Display and a Smart Use of Ann...
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
Koalas: Unifying Spark and pandas APIs
Koalas: Unifying Spark and pandas APIsKoalas: Unifying Spark and pandas APIs
Koalas: Unifying Spark and pandas APIs
 

Plus de EESTEC LC Trieste

Plus de EESTEC LC Trieste (18)

ESS 2013: Osmiza may gic
ESS 2013: Osmiza may gicESS 2013: Osmiza may gic
ESS 2013: Osmiza may gic
 
ESS 2013: Whats art
ESS 2013: Whats artESS 2013: Whats art
ESS 2013: Whats art
 
ESS 2013: Osmizeyourself
ESS 2013: OsmizeyourselfESS 2013: Osmizeyourself
ESS 2013: Osmizeyourself
 
ESS 2013: Triesting around
ESS 2013: Triesting aroundESS 2013: Triesting around
ESS 2013: Triesting around
 
ESS 2013: Catchmybus
ESS 2013: CatchmybusESS 2013: Catchmybus
ESS 2013: Catchmybus
 
Ankara
AnkaraAnkara
Ankara
 
EESTEC Summer School 2012 - java script & jquery - Matic Jesenovec
EESTEC Summer School 2012 - java script & jquery - Matic JesenovecEESTEC Summer School 2012 - java script & jquery - Matic Jesenovec
EESTEC Summer School 2012 - java script & jquery - Matic Jesenovec
 
EESTEC Summer School 2012 - Photoshop - Giulia Galvani
EESTEC Summer School 2012 - Photoshop - Giulia GalvaniEESTEC Summer School 2012 - Photoshop - Giulia Galvani
EESTEC Summer School 2012 - Photoshop - Giulia Galvani
 
EESTEC Summer School 2012 - Logo Design - Darija Dašić
EESTEC Summer School 2012 - Logo Design - Darija DašićEESTEC Summer School 2012 - Logo Design - Darija Dašić
EESTEC Summer School 2012 - Logo Design - Darija Dašić
 
EESTEC Summer School 2012 - Vector Design - Darija Dašić
EESTEC Summer School 2012 - Vector Design - Darija DašićEESTEC Summer School 2012 - Vector Design - Darija Dašić
EESTEC Summer School 2012 - Vector Design - Darija Dašić
 
EESTEC Summer School 2012 - Branding Guidelines - Milosh Pivic
EESTEC Summer School 2012 - Branding Guidelines - Milosh PivicEESTEC Summer School 2012 - Branding Guidelines - Milosh Pivic
EESTEC Summer School 2012 - Branding Guidelines - Milosh Pivic
 
EESTEC Summer School 2012 - Group 7 - red cells
EESTEC Summer School 2012 - Group 7 - red cellsEESTEC Summer School 2012 - Group 7 - red cells
EESTEC Summer School 2012 - Group 7 - red cells
 
EESTEC Summer School 2012 - Group 8 - tridentinas
EESTEC Summer School 2012 - Group 8 - tridentinasEESTEC Summer School 2012 - Group 8 - tridentinas
EESTEC Summer School 2012 - Group 8 - tridentinas
 
EESTEC Summer School 2012 - Group 10 - vampire hunters
EESTEC Summer School 2012 - Group 10 - vampire huntersEESTEC Summer School 2012 - Group 10 - vampire hunters
EESTEC Summer School 2012 - Group 10 - vampire hunters
 
EESTEC Summer School 2012 - Group 9 - kuma
EESTEC Summer School 2012 - Group 9 - kumaEESTEC Summer School 2012 - Group 9 - kuma
EESTEC Summer School 2012 - Group 9 - kuma
 
EESTEC Summer School 2012 - Group 5 - material
EESTEC Summer School 2012 - Group 5 - materialEESTEC Summer School 2012 - Group 5 - material
EESTEC Summer School 2012 - Group 5 - material
 
EESTEC Summer School 2012 - Group 3 - itado
EESTEC Summer School 2012 - Group 3 - itadoEESTEC Summer School 2012 - Group 3 - itado
EESTEC Summer School 2012 - Group 3 - itado
 
EESTEC Summer School 2012 - Group 2 - Be+
EESTEC Summer School 2012 - Group 2 - Be+EESTEC Summer School 2012 - Group 2 - Be+
EESTEC Summer School 2012 - Group 2 - Be+
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Dernier (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

EESTEC Summer School 2012 - Entity Framework - Erni Durdevic

  • 1.
  • 2. Sql data access (Classic style) SQL String: «SELECT x, y FROM TblPoints» Entity Framework
  • 3. Sql data access with EF  Entity Framework takes care of the DB interactions and makes it easy to access relational data. LINQ «SQL» Entity Framework
  • 4. What is the Model? Farm Model Farm Pig s Ducks Rabbits
  • 5. Database Farm Pig s Farm DB Duck s Rabb its
  • 6. Entity Framework model Our software Farm Pig s Duck s Farm Model Farm DB Rabb its
  • 7. EF Model  Database-First Farm DB Farm Model  Code-first Farm Model Farm DB
  • 8. EF –DB first  DB First  When you have a ready DB and you want to access the existing data  If you better prefer to build the database first, and automatically create the model
  • 9. EF –DB first  Demo: › Create a DB › Import it in into Visual Studio › See what has been generated  EDMX  Mappings  C#  Class diagram
  • 10. EF –Model first  Model First › When you are building a new solution from scratch (New approach)
  • 11. EF –Model first  Demo... › Create the model › Create an empty DB › Generate the DB schema
  • 12. EF –Model first  Demo › Reference the Entity solution in a separate project  Add reference  Copy the connection string  Reference System.Data.Entity › Query data with LINQ  Select  Update  Insert  Delete