Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE

Does the WorkflowInit class need to be static? How can I use the dependency injection in this case?

It is absolutely not necessary. WorkflowRuntime does not have to be static, and neither where it is located in WorkflowInit class.

However, it is highly recommended having WorkflowRuntime as Singleton. Most DI Frameworks support Singleton pattern, so you just need to create WorkflowService non-static class and register it as Singleton.

WorkflowInit must be Singleton and also must include WorkflowRuntime.