Table of Contents

Injectable services

Screenplay explicitly supports dependency-injection of the following services from the Screenplay architecture into your performance logic. These are in addition to any services you may have configured yourself within DI.

Whilst it may be possible to inject other services from Screenplay's architecture, these are explicitly supported throughout all integrations.

The Stage

Inject the IStage into your performance logic to get and work with Actors. This is the recommended way to manage any actors involved in a performance.

The stage provides all the functionality of the Cast (below) as well as control of the spotlight, should you wish to use it.

The Cast

The ICast is available for dependency injection into your performance logic as an alternative mechanism by which to work with Actors. It is recommended to inject the Stage (above) instead of the Cast. The Cast is reachable from the Stage should you need it, via the Cast property.

The Performance

You may inject an instance of IPerformance to gain direct access to the current performance object, from within your performance logic. Whilst supported, it is usually not required (or recommended) to inject this object into your performance logic.