Hello World
In this topic, we'll setup a simple Console and an ASP.NET Core application that can host and execute workflows.
Console
Modify Program.cs
Open Program.cs
and replace its contents with the following:
This code sets up a service container and adds Elsa services to it. The serviceProvider
can be used to resolve Elsa services and run workflows.
ASP.NET Core
Create the Project
Create a new empty ASP.NET app using the following command:
Add Packages
Navigate to your project's root directory and install the Elsa package:
Modify Program.cs
Open Program.cs
in your project and replace its contents with the code provided below.
Program.cs
Add HttpHelloWorld Workflow
Create a new directory called Workflows
and add a new file to it called HttpHelloWorld.cs
with the following.
Workflows/HttpHelloWorld.cs
Summary
This document explains setting up Console and ASP.NET Core apps using Elsa workflows. For the Console app, we configured a service container, added Elsa, and ran a "Hello World" workflow. The ASP.NET Core app integrates Elsa with HTTP endpoints to process workflows. Follow the code samples for package additions and Program.cs
configurations. Refer to source code links for further details.
Source Code
Last updated