AWE Registration using deligates

PHOTO EMBED

Thu Aug 04 2022 18:30:41 GMT+0000 (UTC)

Saved by @NeTcpMoeIp #c# #oneinc.lib

        /// <summary>
        ///     Register needed services and options for the Application Workflow Engine
        /// </summary>
        /// <param name="service"></param>
        /// <param name="workflowOptionsDelegate">Optional parameter</param>
        public static void AddApplicationWorkflowEngine(
            this IServiceCollection service,
            Action<ApplicationWorkflowEngineOptions> workflowOptionsDelegate = null)
        {
            // required by DI
            if (workflowOptionsDelegate != null)
            {
                service.Configure(workflowOptionsDelegate);
            }
            else
            {
                service.AddOptions<ApplicationWorkflowEngineOptions>()
                    .Configure(
                        workflowOptions => workflowOptions.XmlWorkflowConfigurationProviderOptions =
                            new XmlWorkflowConfigurationProviderOptions
                            {
                                // folder placed on project level
                                XmlWorkflowConfigurationFullPathToFile =
                                    "../../../../ApplicationWorkflowConfigurations/ApplicationWorkflowConfiguration.xml"
                            });
            }

            service.RegisterApplicationWorkflowEngineServices();
        }
content_copyCOPY