mirror of https://github.com/dapr/dotnet-sdk.git
25 lines
665 B
C#
25 lines
665 B
C#
using Dapr.Workflow;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace WorkflowConsoleApp.Activities
|
|
{
|
|
public record Notification(string Message);
|
|
|
|
public class NotifyActivity : WorkflowActivity<Notification, object>
|
|
{
|
|
readonly ILogger logger;
|
|
|
|
public NotifyActivity(ILoggerFactory loggerFactory)
|
|
{
|
|
this.logger = loggerFactory.CreateLogger<NotifyActivity>();
|
|
}
|
|
|
|
public override Task<object> RunAsync(WorkflowActivityContext context, Notification notification)
|
|
{
|
|
this.logger.LogInformation(notification.Message);
|
|
|
|
return Task.FromResult<object>(null);
|
|
}
|
|
}
|
|
}
|