示例#1
0
        public void CreateGeneric_WithCustomSerializerOnDefaultActorProxyFactory_Succeeds()
        {
            var factory = new ActorProxyFactory();

            factory.DefaultOptions.JsonSerializerOptions = new JsonSerializerOptions();

            var actorId = new ActorId("abc");
            var proxy   = (ActorProxy)factory.CreateActorProxy <ITestActor>(actorId, "TestActor");

            Assert.Same(factory.DefaultOptions.JsonSerializerOptions, proxy.JsonSerializerOptions);
        }
示例#2
0
 /// <summary>
 /// Creates a proxy to the actor object that implements an actor interface.
 /// </summary>
 /// <typeparam name="TActorInterface">
 /// The actor interface implemented by the remote actor object.
 /// The returned proxy object will implement this interface.
 /// </typeparam>
 /// <param name="actorId">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.</param>
 /// <param name="actorType">
 /// Type of actor implementation.
 /// </param>
 /// <returns>Proxy to the actor object.</returns>
 public static TActorInterface Create <TActorInterface>(ActorId actorId, string actorType)
     where TActorInterface : IActor
 {
     return(DefaultProxyFactory.CreateActorProxy <TActorInterface>(actorId, actorType));
 }