2020-10-29 10:42:38 +00:00
|
|
|
using Elsa.Samples.WhileLoopWorker.Services;
|
|
|
|
|
using Elsa.Samples.WhileLoopWorker.Workflows;
|
2020-10-29 08:24:02 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2020-10-29 10:42:38 +00:00
|
|
|
using NodaTime;
|
2020-10-29 08:24:02 +00:00
|
|
|
|
|
|
|
|
namespace Elsa.Samples.WhileLoopWorker
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
|
|
|
Host.CreateDefaultBuilder(args)
|
2020-10-29 10:42:38 +00:00
|
|
|
.ConfigureServices(
|
|
|
|
|
(hostContext, services) =>
|
|
|
|
|
{
|
|
|
|
|
services
|
2020-11-03 10:13:57 +00:00
|
|
|
.AddElsa()
|
2020-10-29 10:42:38 +00:00
|
|
|
.AddConsoleActivities()
|
|
|
|
|
.AddTimerActivities(options => options.SweepInterval = Duration.FromSeconds(1))
|
|
|
|
|
.AddSingleton<PhoneCallService>()
|
|
|
|
|
.AddHostedService<PhoneCallWorker>()
|
|
|
|
|
.AddWorkflow<PhoneCallWorkflow>();
|
|
|
|
|
});
|
2020-10-29 08:24:02 +00:00
|
|
|
}
|
|
|
|
|
}
|