SlideShare a Scribd company logo
INTRODUCING ENTITY
FRAMEWORK CORE
WHAT WE GET FROM THE CHAPTER
Some New Definitions.
Installing Visual Studio 2017
Open a new Projects.
Updating Using Entity State
Deleting Records using Entity State
Adding the Core Repository Interface and Base Class
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
2
WHAT IS ENTITY FRAMEWORK CORE ?
Entity Framework (EF) Core is a lightweight, extensible, and
cross-platform version of the popular Entity Framework
data access technology.
EF Core is an object-relational mapper that enables .NET
developers to work with a database using .NET objects. It
eliminates the need for most of the data-access code that
developers usually need to write.
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
3
DATA ANNOTATIONS IN
ENTITYBASE
Data Annotation in .Net framework means add extra meaning to
the data by adding attribute tags. The advantage of using Data
Annotation feature is that by applying Data Attributes we can
manage the data definition in a single place and do not need re-
write the same rules in multiple places.
The Data Annotation feature got introduced in .Net 3.5 and
the System.ComponentModel.DataAnnotations namespace
contains the classes that are used as data attributes.
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
4
MIGRATIONS
When application models are added,deleted or changed,the physical data store needs
to be updated to match the shape of the application data model.
I. Create , delete, or update the model classes or the context class.
II. Create a new migration.
III. Apply that migration to the database. Or create the script file for the migration for
execution elsewhere.(such as SQL Server Management Studio)
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
5
OBJECT-RELATIONAL MAPPING
Object-relational mapping is a programming technique
for converting data between incompatible type
systems using object-oriented programming languages.
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
6
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
7
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
8
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
9
Updating
Using
Entity State
Make sure the
entity is not already
being tracked in the
context
Create a new
instance of the
Category class
Set all of the fields
to the correct values
Set the EntityState
to
EntityState.Modified
Call SaveChanges()
on the StoreContext
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
10
ADDING THE CORE REPOSITORY INTERFACE
AND BASE CLASS
A common data access design pattern is the
repository pattern . This helps to eliminate
duplication of code.
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
11
1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT
12

More Related Content

What's hot

SPS Stockholm Introduce Redux in your SPFx solution
SPS Stockholm   Introduce Redux in your SPFx solutionSPS Stockholm   Introduce Redux in your SPFx solution
SPS Stockholm Introduce Redux in your SPFx solution
Yannick Borghmans
 
Reproducibility with Unstructured Data in 3 steps
Reproducibility with Unstructured Data in 3 stepsReproducibility with Unstructured Data in 3 steps
Reproducibility with Unstructured Data in 3 steps
Gleb Mezhanskiy
 
Ado Net
Ado NetAdo Net
Data Testing
Data TestingData Testing
Data Testing
Gleb Mezhanskiy
 
Ds new
Ds newDs new
Ds new
CS_GDRCST
 
Domain model
Domain modelDomain model
Domain model
Chandrapriya Jayabal
 
Testing Two-Way Data Binding in AngularJS
Testing Two-Way Data Binding in AngularJSTesting Two-Way Data Binding in AngularJS
Testing Two-Way Data Binding in AngularJS
Backand Cohen
 
Presentation
PresentationPresentation
Presentation
SeanTRobinson
 
Eugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi PortfolioEugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi Portfolio
i661e21
 

What's hot (9)

SPS Stockholm Introduce Redux in your SPFx solution
SPS Stockholm   Introduce Redux in your SPFx solutionSPS Stockholm   Introduce Redux in your SPFx solution
SPS Stockholm Introduce Redux in your SPFx solution
 
Reproducibility with Unstructured Data in 3 steps
Reproducibility with Unstructured Data in 3 stepsReproducibility with Unstructured Data in 3 steps
Reproducibility with Unstructured Data in 3 steps
 
Ado Net
Ado NetAdo Net
Ado Net
 
Data Testing
Data TestingData Testing
Data Testing
 
Ds new
Ds newDs new
Ds new
 
Domain model
Domain modelDomain model
Domain model
 
Testing Two-Way Data Binding in AngularJS
Testing Two-Way Data Binding in AngularJSTesting Two-Way Data Binding in AngularJS
Testing Two-Way Data Binding in AngularJS
 
Presentation
PresentationPresentation
Presentation
 
Eugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi PortfolioEugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi Portfolio
 

Similar to Introducing Entity Framework Core

Comparing the performance of a business process: using Excel & Python
Comparing the performance of a business process: using Excel & PythonComparing the performance of a business process: using Excel & Python
Comparing the performance of a business process: using Excel & Python
IRJET Journal
 
IRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema GeneratorIRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema Generator
IRJET Journal
 
Uma SunilKumar Resume
Uma SunilKumar ResumeUma SunilKumar Resume
Uma SunilKumar Resume
Uma Sunilkumar
 
Super applied in a sitecore migration project
Super applied in a sitecore migration projectSuper applied in a sitecore migration project
Super applied in a sitecore migration project
dodoshelu
 
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND MLHOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
IRJET Journal
 
Database Engine Control though Web Portal Monitoring Configuration
Database Engine Control though Web Portal Monitoring ConfigurationDatabase Engine Control though Web Portal Monitoring Configuration
Database Engine Control though Web Portal Monitoring Configuration
IRJET Journal
 
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
IRJET Journal
 
VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011
djmichael156
 
System development project document
System development project documentSystem development project document
System development project document
Smit Patel
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
Araf Karsh Hamid
 
Comparative Analysis of Bootstrap and UIkit framework
Comparative Analysis of Bootstrap and UIkit frameworkComparative Analysis of Bootstrap and UIkit framework
Comparative Analysis of Bootstrap and UIkit framework
IRJET Journal
 
IRJET- Plug-In based System for Data Visualization
IRJET- Plug-In based System for Data VisualizationIRJET- Plug-In based System for Data Visualization
IRJET- Plug-In based System for Data Visualization
IRJET Journal
 
Pratk kambe rac
Pratk kambe racPratk kambe rac
Pratk kambe rac
Pratik Kambe
 
Accel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptxAccel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptx
NTTDATA INTRAMART
 
Cisco project ideas
Cisco   project ideasCisco   project ideas
Cisco project ideas
VIT University
 
Comprehensive Guide for Microsoft Fabric to Master Data Analytics
Comprehensive Guide for Microsoft Fabric to Master Data AnalyticsComprehensive Guide for Microsoft Fabric to Master Data Analytics
Comprehensive Guide for Microsoft Fabric to Master Data Analytics
Sparity1
 
BI Environment Technical Analysis
BI Environment Technical AnalysisBI Environment Technical Analysis
BI Environment Technical Analysis
Ryan Casey
 
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/StudioMigrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
Michael Findling
 
Template based framework for rapid fast development of enterprise applications
Template based framework for rapid fast development of enterprise applicationsTemplate based framework for rapid fast development of enterprise applications
Template based framework for rapid fast development of enterprise applications
eSAT Journals
 
Template based framework for rapid fast development
Template based framework for rapid fast developmentTemplate based framework for rapid fast development
Template based framework for rapid fast development
eSAT Publishing House
 

Similar to Introducing Entity Framework Core (20)

Comparing the performance of a business process: using Excel & Python
Comparing the performance of a business process: using Excel & PythonComparing the performance of a business process: using Excel & Python
Comparing the performance of a business process: using Excel & Python
 
IRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema GeneratorIRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema Generator
 
Uma SunilKumar Resume
Uma SunilKumar ResumeUma SunilKumar Resume
Uma SunilKumar Resume
 
Super applied in a sitecore migration project
Super applied in a sitecore migration projectSuper applied in a sitecore migration project
Super applied in a sitecore migration project
 
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND MLHOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
HOUSE PRICE ESTIMATION USING DATA SCIENCE AND ML
 
Database Engine Control though Web Portal Monitoring Configuration
Database Engine Control though Web Portal Monitoring ConfigurationDatabase Engine Control though Web Portal Monitoring Configuration
Database Engine Control though Web Portal Monitoring Configuration
 
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
IRJET- A Repository Application Developed using .Net MVC and Angularjs for In...
 
VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011VRE Cancer Imaging BL RIC Workshop 22032011
VRE Cancer Imaging BL RIC Workshop 22032011
 
System development project document
System development project documentSystem development project document
System development project document
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Comparative Analysis of Bootstrap and UIkit framework
Comparative Analysis of Bootstrap and UIkit frameworkComparative Analysis of Bootstrap and UIkit framework
Comparative Analysis of Bootstrap and UIkit framework
 
IRJET- Plug-In based System for Data Visualization
IRJET- Plug-In based System for Data VisualizationIRJET- Plug-In based System for Data Visualization
IRJET- Plug-In based System for Data Visualization
 
Pratk kambe rac
Pratk kambe racPratk kambe rac
Pratk kambe rac
 
Accel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptxAccel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptx
 
Cisco project ideas
Cisco   project ideasCisco   project ideas
Cisco project ideas
 
Comprehensive Guide for Microsoft Fabric to Master Data Analytics
Comprehensive Guide for Microsoft Fabric to Master Data AnalyticsComprehensive Guide for Microsoft Fabric to Master Data Analytics
Comprehensive Guide for Microsoft Fabric to Master Data Analytics
 
BI Environment Technical Analysis
BI Environment Technical AnalysisBI Environment Technical Analysis
BI Environment Technical Analysis
 
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/StudioMigrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
Migrating from CA AllFusionTM ERwin® Data Modeler to Embarcadero ER/Studio
 
Template based framework for rapid fast development of enterprise applications
Template based framework for rapid fast development of enterprise applicationsTemplate based framework for rapid fast development of enterprise applications
Template based framework for rapid fast development of enterprise applications
 
Template based framework for rapid fast development
Template based framework for rapid fast developmentTemplate based framework for rapid fast development
Template based framework for rapid fast development
 

More from Joy Sarker

Development of-pharmacy-management-system
Development of-pharmacy-management-systemDevelopment of-pharmacy-management-system
Development of-pharmacy-management-system
Joy Sarker
 
Interrupt
InterruptInterrupt
Interrupt
Joy Sarker
 
Network Troubleshooting
Network TroubleshootingNetwork Troubleshooting
Network Troubleshooting
Joy Sarker
 
Introducing asp.net core mvc web application
Introducing asp.net core mvc web applicationIntroducing asp.net core mvc web application
Introducing asp.net core mvc web application
Joy Sarker
 
Building the data access layer with entity framework
Building the data access layer with entity frameworkBuilding the data access layer with entity framework
Building the data access layer with entity framework
Joy Sarker
 
Computer memory
Computer memoryComputer memory
Computer memory
Joy Sarker
 

More from Joy Sarker (6)

Development of-pharmacy-management-system
Development of-pharmacy-management-systemDevelopment of-pharmacy-management-system
Development of-pharmacy-management-system
 
Interrupt
InterruptInterrupt
Interrupt
 
Network Troubleshooting
Network TroubleshootingNetwork Troubleshooting
Network Troubleshooting
 
Introducing asp.net core mvc web application
Introducing asp.net core mvc web applicationIntroducing asp.net core mvc web application
Introducing asp.net core mvc web application
 
Building the data access layer with entity framework
Building the data access layer with entity frameworkBuilding the data access layer with entity framework
Building the data access layer with entity framework
 
Computer memory
Computer memoryComputer memory
Computer memory
 

Recently uploaded

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 

Introducing Entity Framework Core

  • 2. WHAT WE GET FROM THE CHAPTER Some New Definitions. Installing Visual Studio 2017 Open a new Projects. Updating Using Entity State Deleting Records using Entity State Adding the Core Repository Interface and Base Class 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 2
  • 3. WHAT IS ENTITY FRAMEWORK CORE ? Entity Framework (EF) Core is a lightweight, extensible, and cross-platform version of the popular Entity Framework data access technology. EF Core is an object-relational mapper that enables .NET developers to work with a database using .NET objects. It eliminates the need for most of the data-access code that developers usually need to write. 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 3
  • 4. DATA ANNOTATIONS IN ENTITYBASE Data Annotation in .Net framework means add extra meaning to the data by adding attribute tags. The advantage of using Data Annotation feature is that by applying Data Attributes we can manage the data definition in a single place and do not need re- write the same rules in multiple places. The Data Annotation feature got introduced in .Net 3.5 and the System.ComponentModel.DataAnnotations namespace contains the classes that are used as data attributes. 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 4
  • 5. MIGRATIONS When application models are added,deleted or changed,the physical data store needs to be updated to match the shape of the application data model. I. Create , delete, or update the model classes or the context class. II. Create a new migration. III. Apply that migration to the database. Or create the script file for the migration for execution elsewhere.(such as SQL Server Management Studio) 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 5
  • 6. OBJECT-RELATIONAL MAPPING Object-relational mapping is a programming technique for converting data between incompatible type systems using object-oriented programming languages. 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 6
  • 9. 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 9 Updating Using Entity State Make sure the entity is not already being tracked in the context Create a new instance of the Category class Set all of the fields to the correct values Set the EntityState to EntityState.Modified Call SaveChanges() on the StoreContext
  • 11. ADDING THE CORE REPOSITORY INTERFACE AND BASE CLASS A common data access design pattern is the repository pattern . This helps to eliminate duplication of code. 1/19/2018JOYANTA KUMAR SARKER,16103352,CEAT,IUBAT 11