You will see that ObjectContext is used as well
as the EntityConnection class (from the System.Data.EntityClient namespace).
You??™ll see that these classes derive from the ObjectContext class. The ObectContext in the ADO.NET
Entity Framework represents the entity container in the conceptual model. Just like LINQ to SQL and
the DataContext, the ObjectContext class exposes the SaveChanges method, which ushers changes back
336
Appendix B: LINQ to Entities: The ADO.NET Entity Framework
to the underlying database. It is the primary class for interacting with data as objects, serving as the
pathway through which all CRUD (create, read, update, and delete) operations are passed and executed.
Figure B-7
Figure B-8
As you scroll through the .cs file, you will see that it contains all the code necessary to manipulate the
model-provided data, such as adding, deleting, and updating data.
Now you??™re ready to start adding code to utilize the Entity Framework. Open Form1 in design mode and
add a button, a combo box, and a DataViewGrid to the form.
Pages:
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522