Biorąc pod uwagę następujący kod, w jaki sposób EF/DbContext wie o zmianach dokonanych w klienta obiektu:Jak zmienić utwory śledzenia w Entity Framework
class Program
{
static void Main()
{
using(var shopContext = new ShopContext())
{
var customer = shopContext.Customers.Find(7);
customer.City = "Marion";
customer.State = "Indiana";
shopContext.SaveChanges();
}
}
}
public class ShopContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
}
public class Customer
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string City { get; set; }
public string State { get; set; }
}
dziękuję
Dla nowych reaaderów ten wpis na blogu może być pomocny: http://blog.oneunicorn.com/2012/03/10/secrets-of-detectchanges-part-1-what-does-detectchanges-do/ – Karsten