So I have the following code:
// Get the current user
_currentUser = WindowsIdentity.GetCurrent();
// Get the list of address for the current user
_dataMap = new DataMapDataContext();
_addresses = _dataMap.Addresses
.Where(address => address.InsertUserName == _currentUser.Name).ToList();
....
_addresses.Add(form.Item);
_dataMap.SubmitChanges();
When I call SubmitChanges nothing is saved in the database. Why is that? Am I missing the point? I thought with linq to sql you could just add items to your query results and then call SubmitChanges and it will work.... Clearly I am missing something.
Does it now work if you use "ToList"? If not then how do you insert stuff into the collection? (I don't think Add is part of IQueryable.)