When you first
drag an object from the Server Explorer onto the Entities pane, the information is used to provide the
O/R Designer the necessary information that it needs to configure the DataContext.
The next section explains how to define entity classes that will be used to map to database tables and
views, and you??™ll be dragging a table onto the designer to configure the DataContext.
Creating Entity Classes for Tables/View Mapping
When you drag a table from Server Explorer to the O/R Designer??™s Entities, you are creating an entity
class that maps to a database table or view. Figure 15-5 shows what the O/R Designer looks like once
you have dropped a table into that pane.
At this point you have created an entity class. The O/R Designer, behind the scenes, generates the appropriate
classes and applies the appropriate LINQ to SQL attributes to those classes. This entity class now
has all the appropriate properties that map the columns in the selected table. Also, the data connection
information is provided to the designer and will be supplied to the DataContext.
Pages:
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464