我有一个方法可以接收已更改属性的客户对象,我想通过替换该对象的旧版本将其保存回主数据存储中。
有谁知道在下面编写伪代码的正确 C# 方法?
public static void Save(Customer customer)
{
ObservableCollection<Customer> customers = Customer.GetAll();
//pseudo code:
var newCustomers = from c in customers
where c.Id = customer.Id
Replace(customer);
}