Tuesday, 4 February 2014

Basics of Entity Framework–Part 1

 

 

image

 

 

 

 

image

 

 

 

 

image

 

 

 

 

Entity Framework Architecture

 

image

 

 

 

 

Setting up the environment:

 

image

 

 

 

 

Create the First simple Entity Data Model (EDM):

 

image

 

 

 

image

 

 

 

image

 

 

 

image

 

 

 

image

 

 

 

 

image

 

 

 

image

 

 

 

image

 

 

 

 

Querying with EDM:

 

image

 

 

 

image

 

 

 

image

 

 

 

 

Types of Entities in Entity Framework:

 

image

image

 

 

 

image

 

 

 

image

 

Note: Please Visit MSDN for more info.

 

 

 

 

image

 

 

 

 

image

 

 

 

 

Different type of Modelling Types in Entity Framework

 

Code First development with Entity Framework 4.1

 

 

image

 

Note: Please visit EF Code-First Tutorial to learn code first in detail.

 

 

image

 

 

image

 

 

Simple Code First Example:

 

image

 

 

image

 

 

image

 

 

 

Database Initialization:

 

image

 

 

image

 

 

image

 

 

 

Database Initialization Strategies in Code-First:

 

image

 

 

image

 

image

 

 

 

Turn off DB Initializer in Code-First:

 

image

 

 

Seed Database in Code-First:

 

image

 

 

 

 

Inheritance Strategy in Code-First:

 

image

 

TPH:
http://weblogs.asp.net/manavi/archive/2010/12/24/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph.aspx

TPT:
http://weblogs.asp.net/manavi/archive/2010/12/28/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-2-table-per-type-tpt.aspx

TPC:
http://weblogs.asp.net/manavi/archive/2011/01/03/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-3-table-per-concrete-type-tpc-and-choosing-strategy-guidelines.aspx

 

 

 

Configure Domain Classes in Code-First:

image

 

image

 

 

image

 

 

 

DataAnnotation in Code-First:

 

image

 

 

image

 

image


 


 


Fluent API in Code-First:

image


Visit MSDN for more information on DbModelBulder class.


 


 


EntityTypeConfiguration Class in Code-First:

image


 


Visit MSDN for more information on EntityTypeConfiguration class.

 


 


Fluent API Class Hierarchy:

image


 


 


 


Configure One-to-One Relationship:

 


image


 


image


 


 


image


 


 


image


 


 


 


Configure One-to-Many Relationship:

image


 


 


 


image


 


image


 


 


image


 


 


 


Configure Many-to-Many relationship:

 


image


 


image


 


 


 


image


 


image


 


 


 


Migration in Code-First:

 


image


 


 


Automated Migration:

 


image


image


 


image


 


image


 


 


image


 


 


 


Code-based Migration:

image


 


 


image


 


 


image


 


 


image


 


 


 


Model First development with Entity Framework


 


image


 


 


image


 


 


image


 


 


 


Database First development with Entity Framework 4.0


 


image


 


 


 


Entity Lifecycle:


 


image


 


 


 


ObjectStateManager:


 


image


 


 


 


 


Create POCO Entity:


 


image


 


 


image


 


 


image


 


 


image


 


 


 


 


Create Self-Tracking Entities:


 


image


 


 


 


 


Entity Relationships:


 


image


 


 


image


 


 


image


 


 


 


 


Querying Entity Graph:


 


image


 


 


 


image


 


 


 


 


Eager Loading with DBContext


 


image


 


 


 


image


 


 


image


 


 


 


 


Lazy Loading with DBContext


 


image


 


 


image


 


 


 


 


Explicit Loading with DBContext


 


image


 


 


image


 


 


 


 


Significance of SaveChanges:


 


image


 


 


 


 


Persistence in Entity Framework


 


image


 


 


 


Save New Entity with ObjectContext:


 


image


 


 


 


 


Update an Entity with ObjectContext:


 


image


 


 


image


 


 


 


 


Delete an Entity with ObjectContext:


 


image


 


 


image


 


 


 


 


 


DBContext vs ObjectContexts


 


image


 


 


 


 


Create EDM and DBContext in EF 4.3


 


image


 


 


 


image


 


 


 


image


 


 


 


image


 


 


 


image


 


image


 


 


 


image


 


image


 


 


 


 


DBContext Class


 


image


 


image


 


 


 


 


DBSet Class


 


image


 


image


 


 


 


 


DBEntityEntry Class


 


image


 


 


 


 


Working with Entity Property Value


 


image


 


 


 


Local Data


image


 


image


 


 


 


 


Execute Raw SQL Query


 


image


 


image


 


image


 


 


 


 


Validate Entity


 


image


 


 


image


 


image


 


 


 


 


Add Entity using DBContext


 


image


 


image


 


 


 


 


 


Add One-to-One Relationship Entity Graph using DBContext


 


image


 


image


 


 


 


 


Add One-to-Many Relationship Entity Graph using DBContext


 


image


 


image


 


 


image


image


 


 


 


 


Add Many-to-Many Relationship Entity Graph using DBContext


image


 


image


 


image


 


 


 


 


Update Entity using DBContext


 


image


image


 


 


 


 


Update One-to-One Entity using DBContext


 


image


 


image


 


 


 


 


Update One-to-Many Entity using DBContext


 


image


image


 


image


 


image


 


 


 


 


Update Many-to-Many Entity using DBContext


 


image


 


image


 


image


 


 


 


Delete Entity using DBContext


 


image


 


image


 


 


 


 


Stored Procedure in Entity Framework:


 


image


 


 


 


Execute Stored Procedure using DBContext


 


image


 


image


 


image


 


image


 


image


 


image


 


image


 


 


 


Add/Update data using Stored Procedure:


 


image


 


image


 


image


 


 


 


 


DefiningQuery in Entity Framework:


image


 


image


 


 


image


 


 


image


 


 


 


Data binding with ASP.Net application:


 


image


image


 


image


 


image


 


 


 


Blogger Labels: Basics,Framework,Part,Architecture,environment,Create,Data,Model,Types,Entities,Note,Visit,MSDN,info,Different,Code,development,Tutorial,Simple,Example,Database,Initialization,Strategies,Turn,Initializer,Inheritance,Strategy,archive,hierarchy,guidelines,Configure,Domain,Classes,DataAnnotation,Fluent,information,DbModelBulder,EntityTypeConfiguration,Class,Relationship,Many,Migration,Lifecycle,ObjectStateManager,POCO,Self,Relationships,Graph,Eager,DBContext,Lazy,Explicit,Significance,SaveChanges,Persistence,Save,ObjectContext,Update,Delete,ObjectContexts,DBSet,DBEntityEntry,Value,Local,Execute,Query,Validate,Procedure,DefiningQuery,weblogs,manavi,aspx

No comments:

Post a Comment