diff --git a/examples/Actor/ActorClient/Program.cs b/examples/Actor/ActorClient/Program.cs index aeee28386..5d7f06fb2 100644 --- a/examples/Actor/ActorClient/Program.cs +++ b/examples/Actor/ActorClient/Program.cs @@ -18,7 +18,6 @@ namespace ActorClient using System.Threading.Tasks; using Dapr.Actors; using Dapr.Actors.Client; - using Dapr.Actors.Communication; using IDemoActorInterface; /// @@ -69,7 +68,7 @@ public static async Task Main(string[] args) } catch (ActorMethodInvocationException ex) { - if (ex.InnerException is NotImplementedException) + if (ex.InnerException is ActorInvokeException invokeEx && invokeEx.ActualExceptionType is "System.NotImplementedException") { Console.WriteLine($"Got Correct Exception from actor method invocation."); } @@ -111,7 +110,7 @@ public static async Task Main(string[] args) await Task.Delay(5000); Console.WriteLine("Getting details of the registered reminder"); reminder = await proxy.GetReminder(); - Console.WriteLine($"Received reminder is {reminder}."); + Console.WriteLine($"Received reminder is {reminder?.ToString() ?? "None"} (expecting None)."); Console.WriteLine("Registering reminder with ttl and repetitions, i.e. reminder stops when either condition is met - The reminder will repeat 2 times."); await proxy.RegisterReminderWithTtlAndRepetitions(TimeSpan.FromSeconds(5), 2); Console.WriteLine("Getting details of the registered reminder"); diff --git a/examples/Actor/DemoActor/DemoActor.cs b/examples/Actor/DemoActor/DemoActor.cs index 0ab633fcd..62c100f79 100644 --- a/examples/Actor/DemoActor/DemoActor.cs +++ b/examples/Actor/DemoActor/DemoActor.cs @@ -85,9 +85,18 @@ public async Task RegisterReminderWithTtlAndRepetitions(TimeSpan ttl, int repeti await this.RegisterReminderAsync("TestReminder", null, TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1), repetitions, ttl); } - public async Task GetReminder() - { - return await this.GetReminderAsync("TestReminder"); + public async Task GetReminder() + { + var reminder = await this.GetReminderAsync("TestReminder"); + + return reminder is not null + ? new ActorReminderData + { + Name = reminder.Name, + Period = reminder.Period, + DueTime = reminder.DueTime + } + : null; } public Task UnregisterReminder() diff --git a/examples/Actor/IDemoActor/IDemoActor.cs b/examples/Actor/IDemoActor/IDemoActor.cs index adec6df68..c2926a048 100644 --- a/examples/Actor/IDemoActor/IDemoActor.cs +++ b/examples/Actor/IDemoActor/IDemoActor.cs @@ -100,7 +100,7 @@ public interface IDemoActor : IActor /// /// The name of the reminder. /// A task that returns the reminder after completion. - Task GetReminder(); + Task GetReminder(); /// /// Unregisters the registered timer. @@ -132,4 +132,18 @@ public override string ToString() return $"PropertyA: {propAValue}, PropertyB: {propBValue}"; } } + + public class ActorReminderData + { + public string Name { get; set; } + + public TimeSpan DueTime { get; set; } + + public TimeSpan Period { get; set; } + + public override string ToString() + { + return $"Name: {this.Name}, DueTime: {this.DueTime}, Period: {this.Period}"; + } + } } diff --git a/examples/Workflow/WorkflowConsoleApp/WorkflowConsoleApp.csproj b/examples/Workflow/WorkflowConsoleApp/WorkflowConsoleApp.csproj index 0c40eea0c..25c03a419 100644 --- a/examples/Workflow/WorkflowConsoleApp/WorkflowConsoleApp.csproj +++ b/examples/Workflow/WorkflowConsoleApp/WorkflowConsoleApp.csproj @@ -8,7 +8,6 @@ Exe net6 enable - latest 612,618 diff --git a/examples/Workflow/WorkflowUnitTest/WorkflowUnitTest.csproj b/examples/Workflow/WorkflowUnitTest/WorkflowUnitTest.csproj index 9c4a74a17..4ce0c9801 100644 --- a/examples/Workflow/WorkflowUnitTest/WorkflowUnitTest.csproj +++ b/examples/Workflow/WorkflowUnitTest/WorkflowUnitTest.csproj @@ -3,7 +3,6 @@ net6.0 enable - 10 false diff --git a/properties/dapr_managed_netcore.props b/properties/dapr_managed_netcore.props index 59bb68c9a..3bafcb50c 100644 --- a/properties/dapr_managed_netcore.props +++ b/properties/dapr_managed_netcore.props @@ -3,7 +3,7 @@ Debug - 9.0 + 10.0 true 4 false diff --git a/src/Dapr.Workflow/Dapr.Workflow.csproj b/src/Dapr.Workflow/Dapr.Workflow.csproj index 9d8ba1a4e..ef9722d36 100644 --- a/src/Dapr.Workflow/Dapr.Workflow.csproj +++ b/src/Dapr.Workflow/Dapr.Workflow.csproj @@ -9,7 +9,6 @@ Dapr Workflow SDK for building workflows as code with Dapr 0.3.0 alpha - 10.0