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;
}
我所尋找的是一個方法的子對象也沒有通過每一個有循環自動啓用更改跟蹤,並明確告訴它開始跟蹤變化。
在此先感謝您的任何見解。