hi,
i'm playing with linq to sql a bit and have a question :-)
i have something like following and i just wonder how come the updating works what is the mechanism between DataConext.Customer (represent the table) and Customer object which keeps track of changes - i mean i haven't implemented neither INotifyPropertyChanged on object nor INotifyCollectionChanged...
kindly thanks anybody for answering this maybe stupid question...
L
CustomerCollection customers = DataProvider.GetCustomerCollection();
customers[3].FirstName = customers[3].FirstName +
"XXX"; DataProvider.UpdateCustomerCollection(customers);
+
public static CustomerCollection GetCustomerCollection()
{
var query = DataContext.Customer.Select(c => c); CustomerCollection retVal = new CustomerCollection(); foreach (var item in query){
retVal.Add(item);
}
return retVal;}
public static void UpdateCustomerCollection(CustomerCollection customers){
DataContext.SubmitChanges();
}