From 4499dcf5d0080358ceb368317ac4e9bcd84914de Mon Sep 17 00:00:00 2001 From: KarlaCarvajal Date: Thu, 5 Dec 2024 14:44:06 -0500 Subject: [PATCH] feat(dotnet-sdk): Add param to worker method and fix readmes --- sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs | 3 ++- sdk-dotnet/LittleHorse.Sdk/README.md | 5 ++++- sdk-dotnet/README.md | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs b/sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs index 5ba11992a..612225a2b 100644 --- a/sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs +++ b/sdk-dotnet/Examples/WorkerContextExample/MyWorker.cs @@ -5,9 +5,10 @@ namespace WorkerContextExample; public class MyWorker { [LHTaskMethod("task")] - public void ProcessTask(LHWorkerContext context) + public void ProcessTask(long requestTime, LHWorkerContext context) { context.Log("ProcessPayment"); + Console.WriteLine($"Processing request time: {requestTime}"); Console.WriteLine($"The Workflow Run Id is: {context.GetWfRunId()}"); Console.WriteLine($"The Node Run Id is: {context.GetNodeRunId()}"); Console.WriteLine($"The Task Run Id is: {context.GetTaskRunId()}"); diff --git a/sdk-dotnet/LittleHorse.Sdk/README.md b/sdk-dotnet/LittleHorse.Sdk/README.md index a062881e2..42fa90e33 100644 --- a/sdk-dotnet/LittleHorse.Sdk/README.md +++ b/sdk-dotnet/LittleHorse.Sdk/README.md @@ -31,7 +31,7 @@ brew install dotnet ### Build ``` -cd sdk-dotnet/LittleHorse.Sdk +cd sdk-dotnet dotnet build ./LittleHorse.Sdk ``` ### Build and Run tests @@ -45,6 +45,9 @@ dotnet test ./LittleHorse.Sdk.Tests ``` dotnet run --project ./Examples/BasicExample +dotnet run --project ./Examples/ExceptionsHandlerExample +dotnet run --project ./Examples/MaskedFieldsExample +dotnet run --project ./Examples/WorkerContextExample ``` ### Self-signed TLS certificate diff --git a/sdk-dotnet/README.md b/sdk-dotnet/README.md index 17214520a..2bb7dba8e 100644 --- a/sdk-dotnet/README.md +++ b/sdk-dotnet/README.md @@ -31,7 +31,7 @@ brew install dotnet ### Build ``` -cd sdk-dotnet/LittleHorse.Sdk +cd sdk-dotnet dotnet build ./LittleHorse.Sdk ``` ### Build and Run tests @@ -41,10 +41,13 @@ dotnet build ./LittleHorse.Sdk dotnet test ./LittleHorse.Sdk.Tests ``` -### Run Example +### Run Examples ``` dotnet run --project ./Examples/BasicExample +dotnet run --project ./Examples/ExceptionsHandlerExample +dotnet run --project ./Examples/MaskedFieldsExample +dotnet run --project ./Examples/WorkerContextExample ``` ### Self-signed TLS certificate