diff --git a/src/Dapr.Actors/Client/ActorProxy.cs b/src/Dapr.Actors/Client/ActorProxy.cs index 880627bd..7c80bd6d 100644 --- a/src/Dapr.Actors/Client/ActorProxy.cs +++ b/src/Dapr.Actors/Client/ActorProxy.cs @@ -5,6 +5,7 @@ namespace Dapr.Actors.Client { + using System; using System.IO; using System.Text; using System.Text.Json; @@ -59,6 +60,25 @@ namespace Dapr.Actors.Client return DefaultProxyFactory.CreateActorProxy(actorId, actorType); } + /// + /// Creates a proxy to the actor object that implements an actor interface. + /// + /// The actor ID of the proxy actor object. Methods called on this proxy will result in requests + /// being sent to the actor with this ID. + /// + /// The actor interface type implemented by the remote actor object. + /// The returned proxy object will implement this interface. + /// + /// + /// Type of actor implementation. + /// + /// Proxy to the actor object. + public static object Create(ActorId actorId, Type actorInterfaceType, string actorType) + { + _ = actorInterfaceType as IActor ?? throw new ArgumentException("The interface must implement IActor.", nameof(actorInterfaceType)); + return DefaultProxyFactory.CreateActorProxy(actorId, actorInterfaceType, actorType); + } + /// /// Creates an Actor Proxy for making calls without Remoting. ///