SlideShare a Scribd company logo
1 of 29
Download to read offline
iFour ConsultancyEntity Framework
https://www.ifourtechnolab.com/
 Writing and managing ADO.NET code for data access is a tedious and monotonous job.
Microsoft has provided an ORM framework called "Entity Framework" to automate
database related activities for application
 Object/Relational Mapping (ORM) framework that enables to work with relational data as
domain-specific objects, eliminating the need for most of the data access plumbing code
that developers usually need to write
 Using the Entity Framework, developers issue queries using LINQ, then retrieve and
manipulate data as strongly typed objects
 The Entity Framework's ORM implementation provides services like change tracking,
identity resolution, lazy loading, and query translation
Entity Framework
https://www.ifourtechnolab.com/
 It is a mature ORM from Microsoft and can be used with a wide variety of databases
 There are three approaches to modeling entities using Entity Framework:
 Code First
 Database First
 Model First
Entity Framework Approaches
https://www.ifourtechnolab.com/
 This helps to create the entities in your application by focusing on the domain
requirements
 Once entities have been defined and the configurations specified, create the database
 It gives more control over code - Don't need to work with auto generated code anymore
 If domain classes are ready then create database from the domain classes
Code First
https://www.ifourtechnolab.com/
 The downside to this approach is that any changes to the underlying database schema
would be lost; in this approach code defines and creates the database
 This approach allows to use Entity Framework and define the entity model sans the
designer or XML files
 Use the POCO (Plain Old CLR Objects) approach to define the model and generate
database
 In this approach, create the entity classes. Here's an example; a typical entity class is given
below:
public class Product
{
public int ProductId { get; set; }
public string ProductName { get; set; }
public float Price { get; set; }
}
Code First (Cont.)
https://www.ifourtechnolab.com/
 Next, define a custom data context by extending the DbContext class as shown below:
public class IDGContext : DbContext
{
public DbSet<Product> Products { get; set; }
}
 Lastly, specify the connection string in the configuration file
Code First (Cont.)
https://www.ifourtechnolab.com/
 Use the Database First approach if the database is already designed and is ready
 In this approach, the Entity Data Model (EDM) is created from the underlying database
 As an example, use the database first approach when generating the edmx files in the
Visual Studio IDE from the database
 Manual changes to the database is possible easily and always update the EDM if need be
(for example, if the schema of the underlying database changes)
 To do this, simply update the EDM from the database in the Visual Studio IDE
Database First
https://www.ifourtechnolab.com/
 In the Model First approach create the EDM first, then generate the database from it
 Create an empty EDM using the Entity Data Model Wizard in Visual Studio, define the
entities and their relationships in Visual Studio, then generate the database from this
defined model
 Create entities and define their relationships and associations in the designer in Visual
Studio
 Specify the Key property and the data types for the properties for entities using the
designer. Use partial classes to implement additional features in entities
Model First
https://www.ifourtechnolab.com/
 In the Code First approach, in the Model First approach manual changes to the database
would be lost as the model defines the database
Model First (Cont.)
https://www.ifourtechnolab.com/
 Entity framework supports three types of relationships, same as database:
 One to One
 One to Many
 Many to Many
Entity Relationships
https://www.ifourtechnolab.com/
 As per relationship figure, Student and StudentAddress have a One-to-One relationship
(zero or one)
 A student can have only one or zero address. Entity framework adds Student navigation
property into StudentAddress entity and StudentAddress navigation entity into Student
entity
 Also, StudentAddress entity has StudentId property as PrimaryKey which makes it a
One-to-One relationship
 Student entity class includes StudentAddress navigation property and StudentAddress
includes Student navigation property with foreign key property StudentId. This way EF
handles one-to-one relationship between entities
One-To-One Relationship
https://www.ifourtechnolab.com/
 Example:
public partial class Student
{
public Student()
{
this.Courses = new HashSet<Course>();
}
public int StudentID { get; set; }
public string StudentName { get; set; }
public Nullable<int> StandardId { get; set; }
public byte[] RowVersion { get; set; }
public virtual Standard Standard { get; set; }
public virtual StudentAddress StudentAddress { get; set; }
public virtual ICollection<Course> Courses { get; set; }
}
One-To-One Relationship (Cont.)
https://www.ifourtechnolab.com/
public partial class StudentAddress
{
public int StudentID { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public virtual Student Student { get; set; }
}
One-To-One Relationship (Cont.)
https://www.ifourtechnolab.com/
 The Standard and Teacher entities have a One-to-Many relationship marked by multiplicity
where 1 is for One and * is for many, this means that Standard can have many Teachers
whereas Teacher can associate with only one Standard
 To represent this, The Standard entity has the collection navigation property Teachers
(please notice that it's plural), which indicates that one Standard can have a collection of
Teachers (many teachers)
 And Teacher entity has a Standard navigation property (Not a Collection) which indicates
that Teacher is associated with one Standard
 Also, it contains StandardId foreign key (StandardId is a PK in Standard entity). This makes
it One-to-Many relationship
One-To-Many Relationship
https://www.ifourtechnolab.com/
 Example:
public partial class Standard
{
public Standard()
{
this.Students = new HashSet<Student>();
this.Teachers = new HashSet<Teacher>();
}
public int StandardId { get; set; }
public string StandardName { get; set; }
public string Description { get; set; }
public virtual ICollection<Student> Students { get; set; }
public virtual ICollection<Teacher> Teachers { get; set; }
}
One-To-Many Relationship (Cont.)
https://www.ifourtechnolab.com/
public partial class Teacher
{
public Teacher()
{
this.Courses = new HashSet<Course>();
}
public int TeacherId { get; set; }
public string TeacherName { get; set; }
public Nullable<int> StandardId { get; set; }
public Nullable<int> TeacherType { get; set; }
public virtual ICollection<Course> Courses { get; set; }
public virtual Standard Standard { get; set; }
}
One-To-Many Relationship (Cont.)
https://www.ifourtechnolab.com/
 Student and Course have Many-to-Many relationships marked by * multiplicity. It means
one Student can enroll for many Courses and also, one Course can be be taught to many
Students
 The database design includes StudentCourse joining table which includes the primary key
of both the tables (Student and Course table)
 Entity Framework represents many-to-many relationships by not having entityset for the
joining table in CSDL, instead it manages this through mapping
Many-to-Many Relationship
https://www.ifourtechnolab.com/
 Example:
public partial class Student
{
public Student()
{
this.Courses = new HashSet<Course>();
}
public int StudentID { get; set; }
public string StudentName { get; set; }
public Nullable<int> StandardId { get; set; }
public byte[] RowVersion { get; set; }
public virtual Standard Standard { get; set; }
public virtual StudentAddress StudentAddress { get; set; }
public virtual ICollection<Course> Courses { get; set; }
}
Many-To-Many Relationship (Cont.)
https://www.ifourtechnolab.com/
public partial class Course
{
public Course()
{
this.Students = new HashSet<Student>();
}
public int CourseId { get; set; }
public string CourseName { get; set; }
public System.Data.Entity.Spatial.DbGeography Location { get; set; }
public Nullable<int> TeacherId { get; set; }
public virtual Teacher Teacher { get; set; }
public virtual ICollection<Student> Students { get; set; }
}
Many-To-Many Relationship (Cont.)
https://www.ifourtechnolab.com/
 The Repository pattern is intended to create an abstraction layer between the data access layer
and the business logic layer of an application
 Data access pattern that prompts a more loosely coupled approach to data access
 Create the data access logic in a separate class, or set of classes, called a repository, with the
responsibility of persisting the application's business model.
 MVC controllers interact with repositories to load and persist an application business model. By
taking advantage of dependency injection (DI), repositories can be injected into a controller's
constructor.
Benefits :
 Centralizes the data logic or Web service access logic
 Reduce redundancy of code
 Faster development
 Provides a flexible architecture that can be adapted as the overall design of the application evolves
Repository Pattern in MVC
https://www.ifourtechnolab.com/
 Step 1: Open up our existing MVC application in Visual Studio, that we created in the third part to interact
with database with the help of Entity Framework
 Step 2: Create a folder named Repository and add an Interface to that folder named IEmployeeRepository,
this interface we derive from IDisposable type of interface. We’ll declare methods for CRUD operations on
User entity class over here, choose the names of the method as per choice, but those should be easy to
understand and follow
CREATING REPOSITORY
https://www.ifourtechnolab.com/
Step 3: Extract a class from that interface and call it EmployeeRepository.
This EmployeeRepository class will implement all the methods of that interface, but with
the help of Entity Framework.
 Now here comes the use of our DBContext class MVCEntities, we already have this class in our
existing solution, so we don’t have to touch this class, simply, write our business logic in the
interface methods implemented in EmployeeRepository class:
CREATING REPOSITORY
https://www.ifourtechnolab.com/
CREATING REPOSITORY
https://www.ifourtechnolab.com/
How to use Repository?
 Step 4: Go to the controller, declare the IEmployeeRepository reference, and in the
constructor initialize the object with EmployeeRepository class,
passing DBContext(RepositoryContext) to the constructor as parameter we defined
in EmployeeRepository class:
https://www.ifourtechnolab.com/
Crud operations using Repository
 Get All Employees
 Get Single Employee Detail
https://www.ifourtechnolab.com/
Crud operation using Repository
 Insert Employee
 Update Employee
https://www.ifourtechnolab.com/
Crud operation using Repository
 Delete Employee
https://www.ifourtechnolab.com/
 http://www.tutorialspoint.com/entity_framework/
 http://www.entityframeworktutorial.net/
 http://www.entityframeworktutorial.net/what-is-entityframework.aspx
References
https://www.ifourtechnolab.com/
Thank You.
https://www.ifourtechnolab.com/

More Related Content

What's hot

Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast trackBinu Bhasuran
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistencePrem Lamsal
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginnersRahul Jain
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1Mahmoud Ouf
 
Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4Mahmoud Ouf
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and designDabbal Singh Mahara
 
Instance Matching
Instance Matching Instance Matching
Instance Matching Robert Isele
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)avocadodb
 
Connected data classes
Connected data classesConnected data classes
Connected data classesaspnet123
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapVikas Jagtap
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5phanleson
 
Data base connectivity and flex grid in vb
Data base connectivity and flex grid in vbData base connectivity and flex grid in vb
Data base connectivity and flex grid in vbAmandeep Kaur
 

What's hot (19)

Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast track
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
JDBC Part - 2
JDBC Part - 2JDBC Part - 2
JDBC Part - 2
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
Intake 38 data access 1
Intake 38 data access 1Intake 38 data access 1
Intake 38 data access 1
 
Intake 38 data access 4
Intake 38 data access 4Intake 38 data access 4
Intake 38 data access 4
 
Hibernate III
Hibernate IIIHibernate III
Hibernate III
 
PHP & mySQL Training in Bangalore at myTectra
PHP & mySQL Training in Bangalore at myTectraPHP & mySQL Training in Bangalore at myTectra
PHP & mySQL Training in Bangalore at myTectra
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
Instance Matching
Instance Matching Instance Matching
Instance Matching
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)
 
Oodbms ch 20
Oodbms ch 20Oodbms ch 20
Oodbms ch 20
 
Connected data classes
Connected data classesConnected data classes
Connected data classes
 
Object oriented data model
Object oriented data modelObject oriented data model
Object oriented data model
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
 
JDBC
JDBCJDBC
JDBC
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5
 
Data base connectivity and flex grid in vb
Data base connectivity and flex grid in vbData base connectivity and flex grid in vb
Data base connectivity and flex grid in vb
 

Similar to An Overview of Entity Framework

Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaJignesh Aakoliya
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenSony Suci
 
Microservices Primer for Monolithic Devs
Microservices Primer for Monolithic DevsMicroservices Primer for Monolithic Devs
Microservices Primer for Monolithic DevsLloyd Faulkner
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3Naga Muruga
 
PowerPoint
PowerPointPowerPoint
PowerPointVideoguy
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity FrameworkJames Johnson
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkRaveendra R
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4James Johnson
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Tony Frame
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot trainingMallikarjuna G D
 
Creational pattern 2
Creational pattern 2Creational pattern 2
Creational pattern 2Naga Muruga
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvcGuo Albert
 
Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkAkhil Mittal
 
How do i connect to that
How do i connect to thatHow do i connect to that
How do i connect to thatBecky Bertram
 

Similar to An Overview of Entity Framework (20)

Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company india
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
 
Microservices Primer for Monolithic Devs
Microservices Primer for Monolithic DevsMicroservices Primer for Monolithic Devs
Microservices Primer for Monolithic Devs
 
Structural pattern 3
Structural pattern 3Structural pattern 3
Structural pattern 3
 
Data access
Data accessData access
Data access
 
PowerPoint
PowerPointPowerPoint
PowerPoint
 
MVC and Entity Framework
MVC and Entity FrameworkMVC and Entity Framework
MVC and Entity Framework
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01Googleappengineintro 110410190620-phpapp01
Googleappengineintro 110410190620-phpapp01
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Creational pattern 2
Creational pattern 2Creational pattern 2
Creational pattern 2
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity Framework
 
How do i connect to that
How do i connect to thatHow do i connect to that
How do i connect to that
 

More from iFour Technolab Pvt. Ltd.

Software for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdfSoftware for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdfiFour Technolab Pvt. Ltd.
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfiFour Technolab Pvt. Ltd.
 
iFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company ProfileiFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company ProfileiFour Technolab Pvt. Ltd.
 
Meetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptxMeetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptxiFour Technolab Pvt. Ltd.
 
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022iFour Technolab Pvt. Ltd.
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabiFour Technolab Pvt. Ltd.
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour TechnolabBasic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.iFour Technolab Pvt. Ltd.
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)iFour Technolab Pvt. Ltd.
 
MongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & ExecutionMongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & ExecutioniFour Technolab Pvt. Ltd.
 
Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)iFour Technolab Pvt. Ltd.
 

More from iFour Technolab Pvt. Ltd. (20)

Software for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdfSoftware for Physiotherapists (+Physio) - Final.pdf
Software for Physiotherapists (+Physio) - Final.pdf
 
Evolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdfEvolution and History of Angular as Web Development Platform.pdf
Evolution and History of Angular as Web Development Platform.pdf
 
iFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company ProfileiFour Technolab - .NET Development Company Profile
iFour Technolab - .NET Development Company Profile
 
Java9to19Final.pptx
Java9to19Final.pptxJava9to19Final.pptx
Java9to19Final.pptx
 
Meetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptxMeetup - IoT with Azure behind the scenes 2022.pptx
Meetup - IoT with Azure behind the scenes 2022.pptx
 
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
LAZY IS NEW SMART LET IoT HANDLE IT - Meet UP 2022
 
NFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptxNFT_Meetup - iFour Technolab.pptx
NFT_Meetup - iFour Technolab.pptx
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour Technolab
 
Basic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.jsBasic Introduction and Overview of Vue.js
Basic Introduction and Overview of Vue.js
 
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour TechnolabBasic Introduction of VSTO Office Add-in Software Development - iFour Technolab
Basic Introduction of VSTO Office Add-in Software Development - iFour Technolab
 
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Case in Legal Industry - iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Healthcare Industry - iFour Technolab Pvt. Ltd.
 
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
Blockchain Use Cases in Financial Services Industry - iFour Technolab Pvt. Ltd.
 
An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)An Introduction of Node Package Manager (NPM)
An Introduction of Node Package Manager (NPM)
 
Tutorial on Node File System
Tutorial on Node File SystemTutorial on Node File System
Tutorial on Node File System
 
MongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & ExecutionMongoDB Introduction, Installation & Execution
MongoDB Introduction, Installation & Execution
 
Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)Controls Use in Windows Presentation Foundation (WPF)
Controls Use in Windows Presentation Foundation (WPF)
 
Agile Project Management with Scrum PDF
Agile Project Management with Scrum PDFAgile Project Management with Scrum PDF
Agile Project Management with Scrum PDF
 
Understanding Agile Development with Scrum
Understanding Agile Development with ScrumUnderstanding Agile Development with Scrum
Understanding Agile Development with Scrum
 

Recently uploaded

Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessAggregage
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...lizamodels9
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Roomdivyansh0kumar0
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Serviceankitnayak356677
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurSuhani Kapoor
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfpollardmorgan
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechNewman George Leech
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...lizamodels9
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 

Recently uploaded (20)

Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for Success
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman Leech
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 

An Overview of Entity Framework

  • 2.  Writing and managing ADO.NET code for data access is a tedious and monotonous job. Microsoft has provided an ORM framework called "Entity Framework" to automate database related activities for application  Object/Relational Mapping (ORM) framework that enables to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write  Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects  The Entity Framework's ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation Entity Framework https://www.ifourtechnolab.com/
  • 3.  It is a mature ORM from Microsoft and can be used with a wide variety of databases  There are three approaches to modeling entities using Entity Framework:  Code First  Database First  Model First Entity Framework Approaches https://www.ifourtechnolab.com/
  • 4.  This helps to create the entities in your application by focusing on the domain requirements  Once entities have been defined and the configurations specified, create the database  It gives more control over code - Don't need to work with auto generated code anymore  If domain classes are ready then create database from the domain classes Code First https://www.ifourtechnolab.com/
  • 5.  The downside to this approach is that any changes to the underlying database schema would be lost; in this approach code defines and creates the database  This approach allows to use Entity Framework and define the entity model sans the designer or XML files  Use the POCO (Plain Old CLR Objects) approach to define the model and generate database  In this approach, create the entity classes. Here's an example; a typical entity class is given below: public class Product { public int ProductId { get; set; } public string ProductName { get; set; } public float Price { get; set; } } Code First (Cont.) https://www.ifourtechnolab.com/
  • 6.  Next, define a custom data context by extending the DbContext class as shown below: public class IDGContext : DbContext { public DbSet<Product> Products { get; set; } }  Lastly, specify the connection string in the configuration file Code First (Cont.) https://www.ifourtechnolab.com/
  • 7.  Use the Database First approach if the database is already designed and is ready  In this approach, the Entity Data Model (EDM) is created from the underlying database  As an example, use the database first approach when generating the edmx files in the Visual Studio IDE from the database  Manual changes to the database is possible easily and always update the EDM if need be (for example, if the schema of the underlying database changes)  To do this, simply update the EDM from the database in the Visual Studio IDE Database First https://www.ifourtechnolab.com/
  • 8.  In the Model First approach create the EDM first, then generate the database from it  Create an empty EDM using the Entity Data Model Wizard in Visual Studio, define the entities and their relationships in Visual Studio, then generate the database from this defined model  Create entities and define their relationships and associations in the designer in Visual Studio  Specify the Key property and the data types for the properties for entities using the designer. Use partial classes to implement additional features in entities Model First https://www.ifourtechnolab.com/
  • 9.  In the Code First approach, in the Model First approach manual changes to the database would be lost as the model defines the database Model First (Cont.) https://www.ifourtechnolab.com/
  • 10.  Entity framework supports three types of relationships, same as database:  One to One  One to Many  Many to Many Entity Relationships https://www.ifourtechnolab.com/
  • 11.  As per relationship figure, Student and StudentAddress have a One-to-One relationship (zero or one)  A student can have only one or zero address. Entity framework adds Student navigation property into StudentAddress entity and StudentAddress navigation entity into Student entity  Also, StudentAddress entity has StudentId property as PrimaryKey which makes it a One-to-One relationship  Student entity class includes StudentAddress navigation property and StudentAddress includes Student navigation property with foreign key property StudentId. This way EF handles one-to-one relationship between entities One-To-One Relationship https://www.ifourtechnolab.com/
  • 12.  Example: public partial class Student { public Student() { this.Courses = new HashSet<Course>(); } public int StudentID { get; set; } public string StudentName { get; set; } public Nullable<int> StandardId { get; set; } public byte[] RowVersion { get; set; } public virtual Standard Standard { get; set; } public virtual StudentAddress StudentAddress { get; set; } public virtual ICollection<Course> Courses { get; set; } } One-To-One Relationship (Cont.) https://www.ifourtechnolab.com/
  • 13. public partial class StudentAddress { public int StudentID { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string State { get; set; } public virtual Student Student { get; set; } } One-To-One Relationship (Cont.) https://www.ifourtechnolab.com/
  • 14.  The Standard and Teacher entities have a One-to-Many relationship marked by multiplicity where 1 is for One and * is for many, this means that Standard can have many Teachers whereas Teacher can associate with only one Standard  To represent this, The Standard entity has the collection navigation property Teachers (please notice that it's plural), which indicates that one Standard can have a collection of Teachers (many teachers)  And Teacher entity has a Standard navigation property (Not a Collection) which indicates that Teacher is associated with one Standard  Also, it contains StandardId foreign key (StandardId is a PK in Standard entity). This makes it One-to-Many relationship One-To-Many Relationship https://www.ifourtechnolab.com/
  • 15.  Example: public partial class Standard { public Standard() { this.Students = new HashSet<Student>(); this.Teachers = new HashSet<Teacher>(); } public int StandardId { get; set; } public string StandardName { get; set; } public string Description { get; set; } public virtual ICollection<Student> Students { get; set; } public virtual ICollection<Teacher> Teachers { get; set; } } One-To-Many Relationship (Cont.) https://www.ifourtechnolab.com/
  • 16. public partial class Teacher { public Teacher() { this.Courses = new HashSet<Course>(); } public int TeacherId { get; set; } public string TeacherName { get; set; } public Nullable<int> StandardId { get; set; } public Nullable<int> TeacherType { get; set; } public virtual ICollection<Course> Courses { get; set; } public virtual Standard Standard { get; set; } } One-To-Many Relationship (Cont.) https://www.ifourtechnolab.com/
  • 17.  Student and Course have Many-to-Many relationships marked by * multiplicity. It means one Student can enroll for many Courses and also, one Course can be be taught to many Students  The database design includes StudentCourse joining table which includes the primary key of both the tables (Student and Course table)  Entity Framework represents many-to-many relationships by not having entityset for the joining table in CSDL, instead it manages this through mapping Many-to-Many Relationship https://www.ifourtechnolab.com/
  • 18.  Example: public partial class Student { public Student() { this.Courses = new HashSet<Course>(); } public int StudentID { get; set; } public string StudentName { get; set; } public Nullable<int> StandardId { get; set; } public byte[] RowVersion { get; set; } public virtual Standard Standard { get; set; } public virtual StudentAddress StudentAddress { get; set; } public virtual ICollection<Course> Courses { get; set; } } Many-To-Many Relationship (Cont.) https://www.ifourtechnolab.com/
  • 19. public partial class Course { public Course() { this.Students = new HashSet<Student>(); } public int CourseId { get; set; } public string CourseName { get; set; } public System.Data.Entity.Spatial.DbGeography Location { get; set; } public Nullable<int> TeacherId { get; set; } public virtual Teacher Teacher { get; set; } public virtual ICollection<Student> Students { get; set; } } Many-To-Many Relationship (Cont.) https://www.ifourtechnolab.com/
  • 20.  The Repository pattern is intended to create an abstraction layer between the data access layer and the business logic layer of an application  Data access pattern that prompts a more loosely coupled approach to data access  Create the data access logic in a separate class, or set of classes, called a repository, with the responsibility of persisting the application's business model.  MVC controllers interact with repositories to load and persist an application business model. By taking advantage of dependency injection (DI), repositories can be injected into a controller's constructor. Benefits :  Centralizes the data logic or Web service access logic  Reduce redundancy of code  Faster development  Provides a flexible architecture that can be adapted as the overall design of the application evolves Repository Pattern in MVC https://www.ifourtechnolab.com/
  • 21.  Step 1: Open up our existing MVC application in Visual Studio, that we created in the third part to interact with database with the help of Entity Framework  Step 2: Create a folder named Repository and add an Interface to that folder named IEmployeeRepository, this interface we derive from IDisposable type of interface. We’ll declare methods for CRUD operations on User entity class over here, choose the names of the method as per choice, but those should be easy to understand and follow CREATING REPOSITORY https://www.ifourtechnolab.com/
  • 22. Step 3: Extract a class from that interface and call it EmployeeRepository. This EmployeeRepository class will implement all the methods of that interface, but with the help of Entity Framework.  Now here comes the use of our DBContext class MVCEntities, we already have this class in our existing solution, so we don’t have to touch this class, simply, write our business logic in the interface methods implemented in EmployeeRepository class: CREATING REPOSITORY https://www.ifourtechnolab.com/
  • 24. How to use Repository?  Step 4: Go to the controller, declare the IEmployeeRepository reference, and in the constructor initialize the object with EmployeeRepository class, passing DBContext(RepositoryContext) to the constructor as parameter we defined in EmployeeRepository class: https://www.ifourtechnolab.com/
  • 25. Crud operations using Repository  Get All Employees  Get Single Employee Detail https://www.ifourtechnolab.com/
  • 26. Crud operation using Repository  Insert Employee  Update Employee https://www.ifourtechnolab.com/
  • 27. Crud operation using Repository  Delete Employee https://www.ifourtechnolab.com/
  • 28.  http://www.tutorialspoint.com/entity_framework/  http://www.entityframeworktutorial.net/  http://www.entityframeworktutorial.net/what-is-entityframework.aspx References https://www.ifourtechnolab.com/