public Customers UpdateCustomer(Customers customer) {
var northwind = getContext();

northwind.AttachTo("Customers", customer);

// Tyto dky nastavuj entit pznak zmny,
// protoe po zavoln metody AttachTo je oznaena jako "unchanged" ObjectStateEntry entry = northwind.ObjectStateManager
.GetObjectStateEntry(customer.EntityKey);
if (entry != null)
entry.SetModified();

// Obnova entity se zachovnm zmn na stran spotebitele.
northwind.Refresh(RefreshMode.ClientWins, customer);

northwind.SaveChanges(true);
return(customer);
}
