/// <summary> /// Registers all discovered <see cref="ClusterKind"/> on the <see cref="ActorSystem"/> <see cref="Cluster"/>. /// </summary> /// <param name="config">The <see cref="ClusterConfig"/>.</param> /// <param name="provider">The <see cref="IServiceProvider"/>.</param> /// <returns>The modified <see cref="ClusterConfig"/>.</returns> public static ClusterConfig WithDiscoveredClusterKinds(this ClusterConfig config, IServiceProvider provider) => config.WithClusterKinds( provider.GetRequiredService <IEnumerable <GrainAndActor> >() .Select(_ => new ClusterKind(_.Kind, CreatePropsFor(_, provider))) .ToArray());