tags:

views:

32

answers:

1

Consider a customer has many orders.

context.AddLink(customer, "orders", order);
context.SetLink(order, "customer", customer);

The data store will be updated correctly with one or the other of these calls (after calling SaveChanges). So why bother calling both as is shown repeatedly in the documentation for WCF DataServices?

A: 

for adding a ref in a "to-many" relationship (new order associated with a customer) call AddLink. For the other way around ("to-one") call setlink.

mike flasko
Well, OK, but the question is why do both? As I stated in the original question the DataStore will be updated with the use of only one of the two methods. Yet, what passes for documentation often shows the use of both in succession.
Huh