Home

MissingSchemaAction

MissingSchemaAction is an enumeration used by the Entity Framework to describe how to handle discrepancies between the conceptual model and the underlying store schema during initialization or schema discovery. It applies when an ObjectContext connects to a database and the store schema does not fully align with the model.

Typical values provide a choice of behavior for how to respond to missing or mismatched schema elements.

Usage often involves configuring a connection’s MissingSchemaAction before or during initialization, for example by setting the

Note that MissingSchemaAction is associated with older, ObjectContext-based versions of the Entity Framework. Modern EF workflows

See also: Entity Framework, ObjectContext, EntityConnection, schema mapping, migrations.

Common
options
include
Throw,
Ignore,
and
Add.
Throw
signals
that
a
mismatch
should
cause
an
exception
to
be
raised.
Ignore
instructs
the
framework
to
proceed
without
reporting
or
addressing
the
missing
elements.
Add
requests
that
the
framework
attempt
to
reconcile
the
situation
by
incorporating
or
adapting
the
missing
schema
elements.
The
exact
semantics
can
vary
between
EF
versions,
but
the
general
idea
is
to
control
whether
and
how
missing
schema
items
are
treated
during
model-store
alignment.
action
on
the
ObjectContext
or
EntityConnection.
This
setting
can
affect
runtime
behavior
and
debugging,
and
it
can
have
security
and
data-integrity
implications
if
it
leads
to
automatic
schema
modifications
in
a
production
environment.
(such
as
those
based
on
DbContext
and
migrations)
use
different
mechanisms
to
handle
schema
mismatches,
and
EF
Core
does
not
include
this
exact
enumeration.