SBarnes wrote:How can you reference WebHookEvents and Webhook from another plugin?
WebHookEvents is a static property of the RESTAPIPlugin class - so you add a plugin reference and then you should have access to that List.
SBarnes wrote:How can you reference WebHookEvents and Webhook from another plugin?
Container.Register<RESTAPIPlugin>(this);
RESTAPIPlugin restAPIPlugin = Container.TryResolve<RESTAPIPlugin>();
Manager.ObjectDictionary.Add("Container", Funq.Container); // Funq.Container requires a reference to ServiceStack.dll
Manager.ObjectDictionary.Add("BusinessLogicPlugin", this);
BusinessLogicPlugin.Webhook(JiwaBusinessLogic.Manager, "", "");
manager.RESTAPI.RESTAPIPlugin
manager.RESTAPI.BusinessLogicPlugin
SBarnes wrote:Thanks Mike
Ok I am assuming for the Business Logic Plugin you would need to do the following:
- Code: Select all
Manager.ObjectDictionary.Add("BusinessLogicPlugin", this);
to make
- Code: Select all
BusinessLogicPlugin.Webhook(JiwaBusinessLogic.Manager, "", "");
work also?
SBarnes wrote:Just an idea would it be possible add a property to the manager called RESTAPI so that you could have
- Code: Select all
manager.RESTAPI.RESTAPIPlugin
and
- Code: Select all
manager.RESTAPI.BusinessLogicPlugin
permanently available going forward otherwise every time you upgrade a system you have to edit the REST API plugin with the instructions you gave?
JiwaFinancials.Jiwa.JiwaServiceModel.RESTAPIPlugin.WebHookEvents.Add(new JiwaFinancials.Jiwa.JiwaServiceModel.WebHookEvent { Name = "salesorder.processed", Description = "Occurs when a sales order is processed" });
Users browsing this forum: No registered users and 1 guest