0
我正在使用STE,并且希望为对象及其子项启用更改跟踪。我现在需要做的就是这样的事情。使用STE在子对象中启用ChangeTracking
int id = 1;
using(CustomerEntities context = new CustomerEntities())
{
CustomerSection custSection = context.CustomerSections.Include("CustomerSections.Customers").SingleOrDefault(p => p.ID == id);
custSection.StartTracking();
foreach(Customer cust in custSection.Customers)
{
cust.StartTracking();
{
return custSection;
}
我所寻找的是一个方法的子对象也没有通过每一个有循环自动启用更改跟踪,并明确告诉它开始跟踪变化。
在此先感谢您的任何见解。