Closed matt-tolliday-iss closed 2 years ago
Good spot. These should indeed be the entity, not the OperationResult so it needs unwrapping.
This has now been updated in an upcoming 1.2.1 patch release and will be on the unstable feed shortly.
Worth noting though is that 1.2.0 was our Umbraco v10 update which makes v10 our minimum Umbraco version dependency so upgrading to Konstrukt 1.2.1 will require you to also update Umbraco.
Also, the deleting/deleted notifications don't have a Before/After property, that's just the Save notifications so this should work as a workaround if you can't upgrade
var subscriber = ((OperationResult<object>)notification.Entity).Model as SubscriberDto;
Describe the bug When using the events under the hood. But you cannot cast to that as it requires a value type, i believe.
KonstruktEntityDeletingNotification
orKonstruktEntityDeletedNotification
the .Entity property is of type "object" and so you cannot, as per the docs, obtain details of the Entity - it looks like it is actually a OperationResultExpected behavior (https://docs.getkonstrukt.net/advanced/events#konstruktentitydeletednotification)
Environment (please complete the following information):