ChangeInterceptor-dan foydalanib, ob'ektlar orasidagi "o'zgarishlar"/mutatsiyalar tekshiriladi

Tashkilotning munosabatlari ChangeInterceptor() ichida qanday o'zgarganini va qanday o'zgarganini ko'rishning biron bir usuli bormi? Quyidagi ma'lumotlar NorthWind ma'lumotlar bazasidan foydalanib, agar siz munosabat bir-biridan ko'p bo'lsa, Buyurtma shaxsni Buyurtma shaxsidan o'chirish/olib tashlash, bir xodimning ko'plab Buyurtma-lariga ega bo'lganligi, Buyurtma xodimini xodimdan qanday qilib olib tashlash mumkinligi haqidagi misol. Properties'in qanday o'zgarganligini ko'rish uchun GetModifiedProperties() ni chaqirishingiz mumkin bo'lgan ObjectStateEntry sinfidan foydalanishni bilaman, ammo qanday qilib Koleksiyonlar/Uyushmalar qanday o'zgarganligini bilib olamiz. RelationshipManager bilan aloqasi bormi?

[ChangeInterceptor("Employees"]
public void OnChangeEmployees(Employee employee, UpdateOperations operations)
{
    //I'm using EntityFramework 4.1
    //We have to dropdown the ObjectContext to detect IA, Independant Association, changes
    ObjectContext ctx = ((IObjectContextAdapter)this.CurrentDataSource).ObjectContext;

    ObjectStateEntry entry = ctx.ObjectStateManager.GetObjectStateEntry(employee);

    //What do I do here for detecting relationship changes.. I.E and Order was added?


} 

Oldindan rahmat.

1

1 javoblar

ChangeInterceptor ishlatish o'rniga ... Faqat SavingChanges voqea işleyicisini ObjectContext-ga joylashtiring. Ushbu maqola , qanday qilib, Biror shaxsning aloqasi ta'sir ko'rganmikin.

0
qo'shib qo'ydi