I have been going through the EF 6 tutorials and one comment that stands out is not to create an Update method.
When i search around everyone else has the Update method so imagine i have the below scenario:
public static void Swap<T>(IList<T> list, int indexA, int indexB)
{
T tmp = list[indexA];
list[indexA] = list[indexB];
list[indexB] = tmp;
}
In my application i get the records
List<Customer> tempList = _uow.Customers.GetAll();
tempList.Swap(1,2); // Records have swapped here and is correctly working
_uow.Save(); // Changes are never updated on the database.
So do i need to make a second call to the database in order to update change the two records (as i already called called GetAll to get the records from the DB)? I’ve used the PlutoContext project as a guide when building this method?