public static void ActivateActor <S>(IActor actor, S state) { if (actor != null) { actor.ActivateAsync().Wait(); if (state != null) { IActorStateManager stateManager = actor.GetType().InvokeMember("StateManager", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetProperty, null, actor, null) as IActorStateManager; if (stateManager != null) { stateManager.SetStateAsync <S>(typeof(S).FullName, state); } } } }