These entity classes are updatable: They can save changes via the SubmitChanges() method of the
DataContext.
Relationships between tables are also supported in the O/R Designer, and it is actually smart enough
to pick them up automatically. For example, Figure 15-6 shows the defined relationship between the
SalesOrderHeader and SalesOrderDetail when the SalesOrderDetail table is dropped onto the O/R
Designer. Double-clicking the relationship line between the two tables opens the Association Editor
dialog, which enables you to change the relationship (association) if necessary.
290
Chapter 15: Advanced LINQ to SQL Topics
Figure 15-5
Figure 15-6
Keep in mind that the O/R Designer only reflects changes one way. That is, changes that you make via
the designer are reflected in the code, but any code changes you make do not show up in the designer.
This means that any code changes you make will be overwritten any time you make changes via the
designer.
If you want to add code, read the section entitled ??????Extending O/R Designer-Generated Code??™??™ later in
this chapter.
Pages:
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465