Following an introductory tutorial for the new DomainService in Silverlight 4 RIA, I got an unexpected exception. When I perform an update the property EntitiesInError[index].EntityConflict.PropertyNames
throws the following exception:
InvalidOperationException: PropertyNames are not available for delete conflicts.
Service method executed:
public void UpdateSr_Supplier(sr_Supplier currentsr_Supplier)
{
// UPDATE the existing sr_Supplier
this.ObjectContext.sr_Supplier.AttachAsModified(currentsr_Supplier, this.ChangeSet.GetOriginal(currentsr_Supplier));
}
From the answer on this thread I gather that I should rather use Silverlight-enabled services with custom service objects (DataContract
and DataMember
), then assign the values of these custom service objects to the actual server objects (generated from the DB model, be that Linq to Sql or the Entity Data Model), and manually call SubmitChanges()
on the DataContext.