Databases Reference
In-Depth Information
FIGURE 2.3 Choosing Data Connection.
When you have configured the connection and clicked Next on the Choose Your Data
Connection page of the Entity Data Model Wizard, you are prompted to select the data-
base objects to include in the model as shown in Figure 2.4. You can choose any number
of existing Tables, Views, and Stored Procedures the wizard detects in the database. For
now, choose a single table, Products, and click Finish.
Usually you want to accept default values for the remaining options on this page. The
option to Pluralize or singularize generated object names instructs the wizard to automatically
determine appropriate entity names based on the table names. For databases, such as
Northwind, where table names are in plural form (Products), the generated entity name
will be singular (Product). This is desirable because in .NET applications, names of classes
that represent a single object are usually in singular form, helping to distinguish them
from collections that can have multiple items.
The option to Include foreign key columns in the model determines whether columns like
SupplierID of the Products table will be available in the application code. This is particu-
larly useful for web applications that have to be stateless and cannot preserve entity
objects between requests. The first version of Entity Framework released in .NET 3.5 SP1
did not support this option, and it exists today only for backward compatibility, allowing
you to turn it off. Keep this option on unless you are working with a model created using
previous versions of the framework.
The Model Namespace setting refers to an internal namespace used by the model itself. It
has nothing to do with the namespace of your application classes, and you can safely
ignore it, leaving the default value suggested by the tool.
Search WWH ::




Custom Search