The data is stored elsewhere and I want to manage it in Orchard and intercept changes so I can immediately synchronize the data.
So I created a custom part and wrote a migration to attach it to the contenttype. I changed the handler to the correct part and I saw that the eventhandlers were being placed.
However the events Creating/Created/Updating/Updated aren't firing anymore...
Do parts need to have fields or can they be used as I'm doing which is more like an empty interface used for 'tagging' classes.
My migration is as follows:
This is my part:
typeof(CountryPart).Name, cfg => cfg
cfg => cfg.WithPart(typeof(CountryPart).Name));
And the handler defining the event handlers
public class CountryPart : ContentPart
public class GenericContentHandler : ContentHandler
public GenericContentHandler(IServicesManager serviceManager)
OnCreating<CountryPart>((context, tags) => serviceManager.CreatingCountry(context.ContentItem));
OnUpdated<CountryPart>((context, tags) => serviceManager.UpdatedCountry(context.ContentItem));