// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // ------------------------------------------------------------ namespace IDemoActorInterface { using System.Threading.Tasks; using Dapr.Actors; /// /// Interface for Actor method. /// public interface IDemoActor : IActor { /// /// Method to save data. /// /// DAta to save. /// A task that represents the asynchronous save operation. Task SaveData(MyData data); /// /// Method to get data. /// /// A task that represents the asynchronous save operation. Task GetData(); /// /// A test method which throws exception. /// /// A task that represents the asynchronous save operation. Task TestThrowException(); /// /// A test method which validates calls for methods with no arguments and no return types. /// /// A task that represents the asynchronous save operation. Task TestNoArgumentNoReturnType(); /// /// Registers a reminder. /// /// A task that represents the asynchronous save operation. Task RegisterReminder(); /// /// Unregisters the registered reminder. /// /// Task representing the operation. Task UnregisterReminder(); /// /// Registers a timer. /// /// A task that represents the asynchronous save operation. Task RegisterTimer(); /// /// Unregisters the registered timer. /// /// A task that represents the asynchronous save operation. Task UnregisterTimer(); } /// /// Data Used by the Sample Actor. /// public class MyData { /// /// Gets or sets the value for PropertyA. /// public string PropertyA { get; set; } /// /// Gets or sets the value for PropertyB. /// public string PropertyB { get; set; } /// public override string ToString() { var propAValue = this.PropertyA ?? "null"; var propBValue = this.PropertyB ?? "null"; return $"PropertyA: {propAValue}, PropertyB: {propBValue}"; } } }