This question is locked. New answers and comments are not allowed.
Hi,
I have Category and Product two classes in my model. I am using following code to insert products in the system
Category cat = DBConetxt.Categories.Where(x=>x.id = CategoryId);
Product xyz = new Product();
cat.products.add(xyz);
Before flushing changes into database I am using following code to determine new inserts
new public void FlushChanges()
{
Telerik.OpenAccess.ContextChanges changes = GetChanges();
foreach (object o in changes.GetInserts<object>())
{
eventHandler.OnPreInsert(o);
}
foreach (object o in changes.GetUpdates<object>())
{
eventHandler.OnPreUpdate(o);
}
base.FlushChanges();
}
I am not getting any onjects from the GetInserts method but flushchanges method is trying to insert new records in database.
Is there any reason GetInserts method in not returning new records?
Thanks,
Paresh
I have Category and Product two classes in my model. I am using following code to insert products in the system
Category cat = DBConetxt.Categories.Where(x=>x.id = CategoryId);
Product xyz = new Product();
cat.products.add(xyz);
Before flushing changes into database I am using following code to determine new inserts
new public void FlushChanges()
{
Telerik.OpenAccess.ContextChanges changes = GetChanges();
foreach (object o in changes.GetInserts<object>())
{
eventHandler.OnPreInsert(o);
}
foreach (object o in changes.GetUpdates<object>())
{
eventHandler.OnPreUpdate(o);
}
base.FlushChanges();
}
I am not getting any onjects from the GetInserts method but flushchanges method is trying to insert new records in database.
Is there any reason GetInserts method in not returning new records?
Thanks,
Paresh