SlideShare ist ein Scribd-Unternehmen logo
1 von 14
ENTITY FRAMEWORK
CODE FIRST
END TO END
Sergey Barskiy
Architect, Tyler Technologies
INTRODUCTION TO EF
• ENTITY FRAMEWORK IN MICROSOFT’S ORM TOOL
• HAS BEEN OUT SINCE 2008
• CODE FIRST HAS BEEN OUT SINCE 2011
WHY ENTITY FRAMEWORK CODE
FIRST
• ORM
• CODE / TYPE SAFETY
• RAPID APPLICATION DEVELOPMENT AND PROTOTYPING
• SUPPORTED AND DEVELOPED BY MICROSOFT
• CONTINUOUS COMMITMENT FROM MICROSOFT
• OPEN SOURCED
• TESTABLE
• FLEXIBLE / CONVENTIONS AND CONFIGURATIONS
APPROACHES
• DAL?
• BUSINESS LAYER?
• UI?
SEPARATION OF CONCERNS
• EF IS DAL TECHNOLOGY
• ISOLATION FROM OTHER LAYERS
• PATTERNS
• REPOSITORY
• DATA MAPPER
• TABLE DATA GATEWAY
• ROW DATA GATEWAY
• DATA MAPPER
DAL STRATEGY
• KEEP DATA (TABLE) OBJECTS CLEAN
• SEPARATE DATA ACCESS FROM DTOS
• CREATE ACCESS INTERFACE
• EXPOSE DATA ACCESS IN A SERVICE LAYER WITH
BUSINESS OBJECTS
• USING MAPPERS TO CUT DOWN ON CODE
DEVELOPING MODEL
• CONFIGURATION OPTIONS
• CONFIGURATION CLASSES
• ATTRIBUTES?
• HANDLING RELATIONSHIPS
• RELATIONSHIP TYPES
• USING FOREIGN KEY COLUMNS
• USING COMPLEX TYPES
• LEGACY DATABASES / EXPLICIT MAPPINGS
HANDLING SCHEMA CHANGES
• CODE FIRST MIGRATIONS
• CREATE DATABASE
• MAINTAIN SCHEMA
• COMMAND LINE MIGRATIONS
• EXPLICIT VS. IMPLICIT MIGRATIONS
• INITIALIZERS (FOR RAPID PROTOTYPING)
• MIGRATING INITIALIZER
CREATING DATA ACCESS LAYER
• REPOSITORY PATTERN
• MEDIATES BETWEEN THE DOMAIN AND DATA MAPPING
LAYERS USING A COLLECTION-LIKE INTERFACE FOR
ACCESSING DOMAIN OBJECTS.
• INTERFACE BASED REPOSITORY
• CQRS
• WRITE VS. READ REPOSITORY
• TAKING DEPENDENCY ON IQUERYABLE?
WORKING WITH VIEWS AND
STORED PROCEDURES
• EF IS NOT ALL-OR-NOTHING ANSWERS
• WRITING CLASSES FOR MATERIALIZATION
• AVOIDING SQL INJECTION
PERFORMANCE
• CACHING CONTEXT
• WEB ENVIRONMENTS
• CRUD EFFICIENCIES
• UPDATE
• DELETE
• SELECT
• LAZY LOADING
• BEWARE OF MULTIPLE QUERIES
DEMO SOLUTION
• ASP.NET MVC
• LAYER SEPARATION VIA PROJECTS
WHAT’S NEW IN EF 6
• ASYNCHRONOUS SUPPORT
• CONNECTION RESILIENCY
• IMPROVED PERFORMANCE
• MANY MORE
CONTACT INFO
• SERGEY@BARSKIY.COM
• WWW.DOTNETSPEAK.COM

Weitere ähnliche Inhalte

Ähnlich wie Entity Framework Code First End to End

TimothyEWhite_MyResume
TimothyEWhite_MyResumeTimothyEWhite_MyResume
TimothyEWhite_MyResume
Tim White
 
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
InSync2011
 
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdfJD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
InSync2011
 

Ähnlich wie Entity Framework Code First End to End (20)

DOC-20240124-WA0017..pptx
DOC-20240124-WA0017..pptxDOC-20240124-WA0017..pptx
DOC-20240124-WA0017..pptx
 
Resume-Santosh
Resume-Santosh Resume-Santosh
Resume-Santosh
 
APIsecure 2023 - How to abuse Terraform to elevate access, Mike McCabe
APIsecure 2023 - How to abuse Terraform to elevate access, Mike McCabeAPIsecure 2023 - How to abuse Terraform to elevate access, Mike McCabe
APIsecure 2023 - How to abuse Terraform to elevate access, Mike McCabe
 
Controls-Con 2019 | Business Track
Controls-Con 2019 | Business TrackControls-Con 2019 | Business Track
Controls-Con 2019 | Business Track
 
Security architecture design patterns iltam 2018 - ofer rivlin
Security architecture design patterns   iltam 2018 - ofer rivlinSecurity architecture design patterns   iltam 2018 - ofer rivlin
Security architecture design patterns iltam 2018 - ofer rivlin
 
How to migrate from Oracle to EDB Postgres
How to migrate from Oracle to EDB PostgresHow to migrate from Oracle to EDB Postgres
How to migrate from Oracle to EDB Postgres
 
How to Migrate from Oracle to EDB Postgres
How to Migrate from Oracle to EDB PostgresHow to Migrate from Oracle to EDB Postgres
How to Migrate from Oracle to EDB Postgres
 
Tahir Celebi Cv En
Tahir Celebi Cv EnTahir Celebi Cv En
Tahir Celebi Cv En
 
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
Modern DevOps across Technologies on premises and clouds with Oracle Manageme...
 
Integration & Microservices
Integration & Microservices Integration & Microservices
Integration & Microservices
 
TimothyEWhite_MyResume
TimothyEWhite_MyResumeTimothyEWhite_MyResume
TimothyEWhite_MyResume
 
Developing Interoperable Components for an Open IoT Foundation
Developing Interoperable Components for an Open IoT Foundation Developing Interoperable Components for an Open IoT Foundation
Developing Interoperable Components for an Open IoT Foundation
 
Alpana_Srivastava
Alpana_SrivastavaAlpana_Srivastava
Alpana_Srivastava
 
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
Eurotech and Red Hat collaboration simplifies Internet of Things integration ...
 
Embedded world 2017
Embedded world 2017Embedded world 2017
Embedded world 2017
 
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
Database & Technology 2 _ Damien Bootsma _ best Practices for capturing meta ...
 
PatriceGenest-en
PatriceGenest-enPatriceGenest-en
PatriceGenest-en
 
UCT IoT Deployment and Challenges
UCT IoT Deployment and ChallengesUCT IoT Deployment and Challenges
UCT IoT Deployment and Challenges
 
Suresh D - T24 Resume
Suresh D - T24 ResumeSuresh D - T24 Resume
Suresh D - T24 Resume
 
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdfJD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
JD Edwards & Peoplesoft 1 | Brent Coutts | Coopers.pdf
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Entity Framework Code First End to End

  • 1. ENTITY FRAMEWORK CODE FIRST END TO END Sergey Barskiy Architect, Tyler Technologies
  • 2. INTRODUCTION TO EF • ENTITY FRAMEWORK IN MICROSOFT’S ORM TOOL • HAS BEEN OUT SINCE 2008 • CODE FIRST HAS BEEN OUT SINCE 2011
  • 3. WHY ENTITY FRAMEWORK CODE FIRST • ORM • CODE / TYPE SAFETY • RAPID APPLICATION DEVELOPMENT AND PROTOTYPING • SUPPORTED AND DEVELOPED BY MICROSOFT • CONTINUOUS COMMITMENT FROM MICROSOFT • OPEN SOURCED • TESTABLE • FLEXIBLE / CONVENTIONS AND CONFIGURATIONS
  • 5. SEPARATION OF CONCERNS • EF IS DAL TECHNOLOGY • ISOLATION FROM OTHER LAYERS • PATTERNS • REPOSITORY • DATA MAPPER • TABLE DATA GATEWAY • ROW DATA GATEWAY • DATA MAPPER
  • 6. DAL STRATEGY • KEEP DATA (TABLE) OBJECTS CLEAN • SEPARATE DATA ACCESS FROM DTOS • CREATE ACCESS INTERFACE • EXPOSE DATA ACCESS IN A SERVICE LAYER WITH BUSINESS OBJECTS • USING MAPPERS TO CUT DOWN ON CODE
  • 7. DEVELOPING MODEL • CONFIGURATION OPTIONS • CONFIGURATION CLASSES • ATTRIBUTES? • HANDLING RELATIONSHIPS • RELATIONSHIP TYPES • USING FOREIGN KEY COLUMNS • USING COMPLEX TYPES • LEGACY DATABASES / EXPLICIT MAPPINGS
  • 8. HANDLING SCHEMA CHANGES • CODE FIRST MIGRATIONS • CREATE DATABASE • MAINTAIN SCHEMA • COMMAND LINE MIGRATIONS • EXPLICIT VS. IMPLICIT MIGRATIONS • INITIALIZERS (FOR RAPID PROTOTYPING) • MIGRATING INITIALIZER
  • 9. CREATING DATA ACCESS LAYER • REPOSITORY PATTERN • MEDIATES BETWEEN THE DOMAIN AND DATA MAPPING LAYERS USING A COLLECTION-LIKE INTERFACE FOR ACCESSING DOMAIN OBJECTS. • INTERFACE BASED REPOSITORY • CQRS • WRITE VS. READ REPOSITORY • TAKING DEPENDENCY ON IQUERYABLE?
  • 10. WORKING WITH VIEWS AND STORED PROCEDURES • EF IS NOT ALL-OR-NOTHING ANSWERS • WRITING CLASSES FOR MATERIALIZATION • AVOIDING SQL INJECTION
  • 11. PERFORMANCE • CACHING CONTEXT • WEB ENVIRONMENTS • CRUD EFFICIENCIES • UPDATE • DELETE • SELECT • LAZY LOADING • BEWARE OF MULTIPLE QUERIES
  • 12. DEMO SOLUTION • ASP.NET MVC • LAYER SEPARATION VIA PROJECTS
  • 13. WHAT’S NEW IN EF 6 • ASYNCHRONOUS SUPPORT • CONNECTION RESILIENCY • IMPROVED PERFORMANCE • MANY MORE