SlideShare a Scribd company logo
1 of 12
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 solutionYannick 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 stepsGleb Mezhanskiy
 
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 AngularJSBackand Cohen
 
Eugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi PortfolioEugene Wabomnor Bi Portfolio
Eugene Wabomnor Bi Portfolioi661e21
 

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 & PythonIRJET Journal
 
IRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema GeneratorIRJET- Automatic Database Schema Generator
IRJET- Automatic Database Schema GeneratorIRJET Journal
 
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 projectdodoshelu
 
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 MLIRJET 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 ConfigurationIRJET 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 22032011djmichael156
 
System development project document
System development project documentSystem development project document
System development project documentSmit Patel
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf 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 frameworkIRJET 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 VisualizationIRJET Journal
 
Accel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptxAccel_Series_2023Autumn_En.pptx
Accel_Series_2023Autumn_En.pptxNTTDATA INTRAMART
 
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 AnalyticsSparity1
 
BI Environment Technical Analysis
BI Environment Technical AnalysisBI Environment Technical Analysis
BI Environment Technical AnalysisRyan 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/StudioMichael 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 applicationseSAT 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 developmenteSAT 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-systemJoy Sarker
 
Network Troubleshooting
Network TroubleshootingNetwork Troubleshooting
Network TroubleshootingJoy 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 applicationJoy 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 frameworkJoy Sarker
 
Computer memory
Computer memoryComputer memory
Computer memoryJoy 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

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Recently uploaded (20)

Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
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
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

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