First look at EF - Myy server

shopholisticSoftware and s/w Development

Dec 13, 2013 (3 years and 10 months ago)

63 views

EF


One of
Microsoft’s

ORMs

Entity

Framework


EF (ORM)

Juhani Välimäki 21.5.2013

O
OP

-

Object
-
oriented

Programming

In the
database

-
Tables

-
Only

1
-
to
-
Many
relatioships

-
Pure join
tables

exist

for

linking

many
-
to
-
many

R
DB



Relational

Database

RDB

Microsoft
Entity

Framework


EF

=
one

of
Microsoft’s

ORMs

(EF data
model

description

file

.
edmx
)

OR
M




Object
Relational

Mapping


E.g
.

Hibernate
,
NHibernate
,
Java
Persistence

API, …

DBMS,
e.g
. MS SQL
Server, Oracle, IBM DB2

Driver
,
adapter

etc.
libraries

In the
web

application

-
Entity

objects

from

EF

-
Many
-
to
-
Many

relatioships

are

ok

-
Pure join
tables

disappear
.

-
EF
manages

many
-
to
-
many

relationships

:
Member

: Idea

Member

will

have

Ideas

collection
, Idea
will

get

Members

collection

and
it

is
enough

to
add

to
one

of
these
, the EF
maintains

the
other

automatically
. The EF
context

must

know


both

objects

=
they

must

be

fetched

from

same

context

object

or

the new
created

object

must

be

attached

to the
same

EF data
context

(
object
)