4
속성을 변경 한 고객 개체를받는 메서드가 있는데 그 개체의 이전 버전을 바꾸어 주 데이터 저장소에 다시 저장하려고합니다.ObservableCollection 내에서 개체를 식별하고 바꿀 수있는 가장 효율적인 방법은 무엇입니까?
아래 코드를 작성하기 위해 올바른 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);
}
고마워. 이번 주 초 비슷한 비슷한 질문을했지만 (http://stackoverflow.com/questions/800091/how-do-i-update-an-existing-element-of-an-observablecollection) 방금 전에했던 것처럼하지 않았습니다. –