diff --git a/docs/get-started-dapr-actor.md b/docs/get-started-dapr-actor.md index fa2f434d..21ccc605 100644 --- a/docs/get-started-dapr-actor.md +++ b/docs/get-started-dapr-actor.md @@ -416,14 +416,14 @@ namespace MyActorClient // Create Actor Proxy instance to invoke the methods defined in the interface var proxy = ActorProxy.Create(actorID, actorType); // Need to specify the method name and response type explicitly - var response = await proxy.InvokeAsync("SetDataAsync", new MyData() + var response = await proxy.InvokeMethodAsync("SetDataAsync", new MyData() { PropertyA = "ValueA", PropertyB = "ValueB", }); Console.WriteLine(response); - var savedData = await proxy.InvokeAsync("GetDataAsync"); + var savedData = await proxy.InvokeMethodAsync("GetDataAsync"); Console.WriteLine(savedData); } ... diff --git a/samples/Actor/ActorClient/Program.cs b/samples/Actor/ActorClient/Program.cs index e6f87910..f07e6401 100644 --- a/samples/Actor/ActorClient/Program.cs +++ b/samples/Actor/ActorClient/Program.cs @@ -70,12 +70,12 @@ namespace ActorClient } } - // Making calls without Remoting, this shows method invocation using InvokeAsync methods, the method name and its payload is provided as arguments to InvokeAsync methods. + // Making calls without Remoting, this shows method invocation using InvokeMethodAsync methods, the method name and its payload is provided as arguments to InvokeMethodAsync methods. Console.WriteLine("Making calls without Remoting."); var nonRemotingProxy = ActorProxy.Create(actorId, "DemoActor"); - await nonRemotingProxy.InvokeAsync("TestNoArgumentNoReturnType"); - await nonRemotingProxy.InvokeAsync("SaveData", data); - var res = await nonRemotingProxy.InvokeAsync("GetData"); + await nonRemotingProxy.InvokeMethodAsync("TestNoArgumentNoReturnType"); + await nonRemotingProxy.InvokeMethodAsync("SaveData", data); + var res = await nonRemotingProxy.InvokeMethodAsync("GetData"); Console.WriteLine("Registering the timer and reminder"); await proxy.RegisterTimer(); diff --git a/src/Dapr.Actors/Builder/ActorProxyGeneratorBuilder.cs b/src/Dapr.Actors/Builder/ActorProxyGeneratorBuilder.cs index ac6d26c5..b8a85b4b 100644 --- a/src/Dapr.Actors/Builder/ActorProxyGeneratorBuilder.cs +++ b/src/Dapr.Actors/Builder/ActorProxyGeneratorBuilder.cs @@ -33,7 +33,7 @@ namespace Dapr.Actors.Builder // TODO Should this search change to BindingFlags.NonPublic this.invokeAsyncMethodInfo = this.proxyBaseType.GetMethod( - "InvokeAsync", + "InvokeMethodAsync", BindingFlags.Instance | BindingFlags.NonPublic, null, CallingConventions.Any, @@ -319,7 +319,7 @@ namespace Dapr.Actors.Builder var objectTask = ilGen.DeclareLocal(typeof(Task)); - // call the base InvokeAsync method + // call the base InvokeMethodAsync method ilGen.Emit(OpCodes.Ldarg_0); // base ilGen.Emit(OpCodes.Ldc_I4, interfaceId); // interfaceId ilGen.Emit(OpCodes.Ldc_I4, methodDescription.Id); // methodId diff --git a/src/Dapr.Actors/Client/ActorProxy.cs b/src/Dapr.Actors/Client/ActorProxy.cs index e4d98d27..aafcd0ad 100644 --- a/src/Dapr.Actors/Client/ActorProxy.cs +++ b/src/Dapr.Actors/Client/ActorProxy.cs @@ -99,7 +99,7 @@ namespace Dapr.Actors.Client /// Object argument for actor method. /// Cancellation Token. /// Response form server. - public async Task InvokeAsync(string method, TRequest data, CancellationToken cancellationToken = default) + public async Task InvokeMethodAsync(string method, TRequest data, CancellationToken cancellationToken = default) { using var stream = new MemoryStream(); await JsonSerializer.SerializeAsync(stream, data); @@ -117,7 +117,7 @@ namespace Dapr.Actors.Client /// Object argument for actor method. /// Cancellation Token. /// Response form server. - public async Task InvokeAsync(string method, TRequest data, CancellationToken cancellationToken = default) + public async Task InvokeMethodAsync(string method, TRequest data, CancellationToken cancellationToken = default) { using var stream = new MemoryStream(); await JsonSerializer.SerializeAsync(stream, data); @@ -133,7 +133,7 @@ namespace Dapr.Actors.Client /// Actor method name. /// Cancellation Token. /// Response form server. - public async Task InvokeAsync(string method, CancellationToken cancellationToken = default) + public async Task InvokeMethodAsync(string method, CancellationToken cancellationToken = default) { var response = await this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, null, cancellationToken); return await JsonSerializer.DeserializeAsync(response); @@ -145,7 +145,7 @@ namespace Dapr.Actors.Client /// Actor method name. /// Cancellation Token. /// Response form server. - public Task InvokeAsync(string method, CancellationToken cancellationToken = default) + public Task InvokeMethodAsync(string method, CancellationToken cancellationToken = default) { return this.actorNonRemotingClient.InvokeActorMethodWithoutRemotingAsync(this.ActorType, this.ActorId.ToString(), method, null, cancellationToken); } @@ -186,7 +186,7 @@ namespace Dapr.Actors.Client /// Request Message Body Value. /// Cancellation Token. /// A representing the result of the asynchronous operation. - protected async Task InvokeAsync( + protected async Task InvokeMethodAsync( int interfaceId, int methodId, string methodName,