Database Reference
In-Depth Information
}
return View(models);
}
The view will display the data that we match up from the EF model to display in
Sub-
scription.cshtml
, which, in turn, will call the
Subscription
controller that will
return the populated models from the database. The database context
nservicebus-
rnentities
is used to access the database, via the connection string, to populate the
MVCApp.DAL.Subscription
model, which is a property of the mapping in the
Models1.edmx
file. The sequence for the
Subscription
controller appears as fol-
lows:
The
Models1.edmx
file is an XML file that defines a conceptual model, a storage mod-
el, and the mapping between these models for the
nservicebus
database. The
.edmx
file also contains the information that is used by the ADO.NET Entity Data Model
Designer (Entity Designer) to render a model graphically. In the following screenshot, we
can see some of the graphical renderings of the file:
This file will contain not only the mappings but also the objects themselves that are trans-
lated, or mapped, to the table. In this example, we populated the