This project is read-only.

How to trigger the handler event OnUpdated

Topics: Customizing Orchard
Feb 4, 2013 at 3:11 AM
I am writing web service to update a content item. But after the content item updated, the OnUpdated event was not triggered.
//Controller Action
public ActionResult AlterIndex(int Id) {
    var myPart = _orchardServices.ContentManager.Get<MyPart>(Id);
    myPart.Index += 1;
    return Json(new { Cumulative =myPart.Cumulative }, JsonRequestBehavior.AllowGet);
//Handler Event
OnUpdated<MyPart>((context, part) => {
    part.Cumulative += part.Index;
How can I have the OnUpdated event triggered? Or do I have to write a service to do the calculation after updated.
Feb 10, 2013 at 8:30 AM
Look at the code in the Core controller that is normally used to persist changes in an item.