---
title: "Class BaseScriptScope<TContext>"
slug: "scripting--stylelabs.m.scripting.types.v1_0.base.basescriptscope-1"
abstract: ""
---
# Class BaseScriptScope<TContext>

Defines the base scope for scripts.

## Inheritance

object

BaseScriptScope<TContext>

## Implements

[IScriptScope](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.base.iscriptscope.html)

## Namespace: StylelabsStylelabs.MStylelabs.M.ScriptingStylelabs.M.Scripting.TypesStylelabs.M.Scripting.Types.V1_0Base

## Assembly: Stylelabs.M.Scripting.Types.dll

## Syntax

```csharp
public class BaseScriptScope<TContext> : IScriptScope
```

## Type Parameters

| Name | Description |
| --- | --- |
| TContext | The content type. |

## Constructors

### BaseScriptScope(TContext, IMClient)

Initializes a new instance of the [BaseScriptScope<TContext>](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.base.basescriptscope-1.html) class.

#### Declaration

```csharp
public BaseScriptScope(TContext context, IMClient client)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| TContext | context | The script context. |
| IMClient | client | The sdk client. |

## Properties

### Context

Gets the script context.

#### Declaration

```csharp
public TContext Context { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| TContext |  |

### ContextObject

Gets the context.

#### Declaration

```csharp
public object ContextObject { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| object |  |

### MClient

Gets the sdk client.

#### Declaration

```csharp
public IMClient MClient { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IMClient |  |

## Methods

### GetAuditData()

Gets the audit data from the script. For performance reasons, if there is nothing to return, null can be returned.

#### Declaration

```csharp
public virtual AuditData GetAuditData()
```

#### Returns

| Type | Description |
| --- | --- |
| [AuditData](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.audit.auditdata.html) | The [AuditData](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.audit.auditdata.html). |

### GetTelemetryData()

Gets the telemetry data from the script.

#### Declaration

```csharp
public virtual TelemetryData GetTelemetryData()
```

#### Returns

| Type | Description |
| --- | --- |
| [TelemetryData](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.telemetry.telemetrydata.html) | The [TelemetryData](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.telemetry.telemetrydata.html). |

### Implements

[IScriptScope](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.base.iscriptscope.html)
