WJb v1.1: From Console Application to Reusable Action
Discover how to build a .NET SMTP email console app and refactor it into a reusable WJb Action for better workflow orchestration.

Stock photo for illustration only, not from the actual event
- Start by building a basic .NET console app to send emails via SMTP
- Extract core business logic into a reusable method before adding frameworks
- Transform standard code into a structured WJb Action with clear results
- Separate business logic from infrastructure to ensure easier testing
Software development with WJb v1.1 introduces a practical approach to shifting from a standard console application into a flexible WJb Action. Before diving into Jobs, Workflows, Steps, or Scheduling, developers should first solve the core problem using a normal console application to ensure the foundation is rock solid.
The process begins by creating a .NET console application that sends an email using SMTP. Executing the dotnet run command should yield an expected Email sent output. The most important rule in this approach is verifying your business logic before introducing infrastructure, as adding WJb will not magically fix a broken console application.

Stock photo for illustration only, not from the actual event
This development pattern emphasizes core-first programming, allowing developers to ensure that raw business logic functions correctly in isolation before binding it to any external workflow or framework dependencies.
Once the initial console solution works, the next step involves moving the business logic into a reusable method, such as calling await EmailSender.SendAsync("john@example.com") and later parameterizing the recipient so the logic becomes truly reusable.
The architectural progression follows a clear path:
- Problem definition
- Working code implementation
- Reusable method extraction
- Action conversion and workflow orchestration
By integrating WJb, the logic evolves into a SendEmailAction that triggers Results.Done(), moves through Steps, and connects to the Next Action. This turns the Action into a portable unit of business logic that can be executed directly, tested thoroughly, or orchestrated seamlessly without forcing developers to learn complex framework concepts upfront.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment