danielgerlag / workflow-core

Lightweight workflow engine for .NET Standard
MIT License
5.33k stars 1.19k forks source link

Why can'not I use constructor function in workflow step function #1241

Open codecodecookie opened 7 months ago

codecodecookie commented 7 months ago

As shown in the following picture,When I want to use efcore in a step, I need a constructor, but when I use it, I start the workflow and can't jump to the first step, who can help me would be very grateful

企业微信截图_17089170281833

jordanwallwork commented 4 months ago

I know it's late, but for the sake of anyone else that this might help, you can inject dependencies into steps, you just have to make sure to register your steps in the IServiceCollection. See the docs here: https://workflow-core.readthedocs.io/en/latest/getting-started/#injecting-dependencies-into-steps