# Interface IActorProvider OptimaJet.Workflow.Core.Plugins.BasicsPlugin.ActorProviders.IActorProvider Allows to thread-safely control collections of actors grouped by schemes. Namespace: [OptimaJet.Workflow.Core.Plugins.BasicsPlugin.ActorProviders](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Plugins.BasicsPlugin.ActorProviders/) ```csharp public interface IActorProvider ``` ## Methods `IEnumerable>> GetAllActors()` Returns a collection of all actors grouped by schemes. ### Returns | Type | Description | | --- | --- | | `IEnumerable` | Collection of all actors grouped by schemes. The keys in a KeyValuePair are scheme codes and the values are collections of actors. | `void SetAllActors(IEnumerable>> schemeActorsPairs)` Replaces all actors grouped by schemes with a new ones. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeActorsPairs` | `IEnumerable` | Collection of all actors grouped by schemes. The keys in a KeyValuePair are scheme codes and the values are collections of actors. | `void UnionAllActors(IEnumerable>> schemeActorsPairs)` Unions actors for each scheme with specified actors from schemaActorsPairs. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeActorsPairs` | `IEnumerable` | Collection of all actors grouped by schemes. The keys in a KeyValuePair are scheme codes and the values are collections of actors. | `IEnumerable GetActors(string schemeCode)` Returns a collection of actors bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | ### Returns | Type | Description | | --- | --- | | `IEnumerable` | Collection of actor names for the specified schemeCode. | `void SetActors(string schemeCode, IEnumerable actors)` Replaces the existing collection of actors bound to the specified schemeCode with a new one. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actors` | `IEnumerable` | Collection of actors names. | `void AddActor(string schemeCode, string actor)` Adds an actor to the collection bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actor` | `String` | Actor name. | `void AddActors(string schemeCode, IEnumerable actors)` Adds an actors to the collection bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actors` | `IEnumerable` | Collection of actors names. | `void RemoveActor(string schemeCode, string actor)` Removes an actor from the collection bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actor` | `String` | Actor name. | `void RemoveActors(string schemeCode, IEnumerable actors)` Removes an actors from the collection bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actors` | `IEnumerable` | Collection of actors names. | `bool IsActorExist(string schemeCode, string actor)` Checks if there is an actor in the collection bound to the schemeCode. ### Parameters | Name | Type | Description | | --- | --- | --- | | `schemeCode` | `String` | The code of the scheme to which the collection of actors is bound. | | `actor` | `String` | Actor name. | ### Returns | Type | Description | | --- | --- | | `Boolean` | Is actor exist in the collection bound to the schemeCode. | [Previous DecisionTable](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Plugins.BasicsPlugin/DecisionTable/) [Next NewtonsoftLoopTypeConverter](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Plugins.LoopsPlugin.Other/NewtonsoftLoopTypeConverter/)