I try to update my objectt task in database, but in parameter I have object which has clean history (I don't get it from database). And my question is :
Is it the best way to update object:
public static void SaveEditedTask(Task task)
{
using (var context=new Entities())
{
var taskToModification = context.Tasks.Where(t => t.IDTask == task.IDTask).First();
taskToModification.IDProject = task.IDProject;
context.SaveChanges();
}
}
?
I use EF4