These objects are instances of entity types. Supporting
both LINQ and Entity SQL queries, Object Services lets you query against defined types as well as track
changes and bind objects to controls.
productSalesContext.Detach(Contact.SalesOrderHeader);
Another good practice is to manage concurrency conflicts in an object context. Making changes back to
the database could cause conflicts, so those need to be handled. In the following example, the
SaveChanges() method is called to save any changes back to the database. If there are any conflicts,
they are caught, the object context is refreshed, and SaveChanges() reapplied.
try
{
//make changes..then save them
productSalesContext.SaveChanges();
}
catch (OptimisticConcurrencyException oce)
{
productSalesContext.Refresh(RefreshMode.ClientWins, Contact);
productSalesContext.SaveChanges();
}
Hopefully, you can see that working with objects is just as simple as working with LINQ to SQL.
Entity Data Model Generator
The Entity Data Model Generator tool is one of the options available to the developer for generating the
entity data model.
Pages:
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530