---
title: "Interface IChangeTracker"
slug: "scripting--stylelabs.m.scripting.types.v1_0.changetracking.ichangetracker"
abstract: ""
---
# Interface IChangeTracker

Adds dirty tracking functionality between Sitecore Content Hub and the SDK. All members in this interface work with the original entity in Sitecore Content Hub to determine whether a member was dirty or not. This is independent from any dirty tracking in the SDK itself.

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

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

## Syntax

```csharp
public interface IChangeTracker
```

## Properties

### InheritsSecurity

Gets information about the InheritsSecurity on the entity.

#### Declaration

```csharp
ISystemPropertyTracker<bool?> InheritsSecurity { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ISystemPropertyTracker](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.generic.isystempropertytracker-1.html)bool |  |

### IsPathRoot

Gets information about the IsPathRoot on the entity.

#### Declaration

```csharp
ISystemPropertyTracker<bool?> IsPathRoot { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ISystemPropertyTracker](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.generic.isystempropertytracker-1.html)bool |  |

### IsRootTaxonomyItem

Gets information about the IsRootTaxonomyItem on the entity.

#### Declaration

```csharp
ISystemPropertyTracker<bool?> IsRootTaxonomyItem { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ISystemPropertyTracker](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.generic.isystempropertytracker-1.html)bool |  |

### IsSystemOwned

Gets information about the IsSystemOwned on the entity.

#### Declaration

```csharp
ISystemPropertyTracker<bool?> IsSystemOwned { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ISystemPropertyTracker](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.generic.isystempropertytracker-1.html)bool |  |

## Methods

### GetChangeSet()

Creates a change set for the current entity.

#### Declaration

```csharp
EntityChangeSet GetChangeSet()
```

#### Returns

| Type | Description |
| --- | --- |
| [EntityChangeSet](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.changeset.entitychangeset.html) | A change set. |

### GetDirtyProperties()

Determines all dirty properties and returns the matching SDK properties. Their values contain the current value.

#### Declaration

```csharp
IReadOnlyList<IProperty> GetDirtyProperties()
```

#### Returns

| Type | Description |
| --- | --- |
| IReadOnlyList<>IProperty | Dirty properties. |

### GetDirtyRelations()

Determines all dirty relations and returns the matching SDK relations. Their ids contain the current ids.

#### Declaration

```csharp
IReadOnlyList<IRelation> GetDirtyRelations()
```

#### Returns

| Type | Description |
| --- | --- |
| IReadOnlyList<>IRelation | Dirty relations. |

### GetNewIds(string, RelationRole?)

Gets the newly added ids on the relation. Returns an empty list if there are no new ids.

#### Declaration

```csharp
IReadOnlyList<long> GetNewIds(string relationName, RelationRole? role = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | relationName | Name of the relation (case-insensitive). |
| RelationRole | role | Role of the relation. |

#### Returns

| Type | Description |
| --- | --- |
| IReadOnlyList<>long | A collection of ids. |

### GetOriginalPropertyValue<T>(string, CultureInfo)

Gets the original value of a property. `T` should preferably be nullable.

#### Declaration

```csharp
T GetOriginalPropertyValue<T>(string propertyName, CultureInfo culture)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | propertyName | Name of the property (case-insensitive). |
| CultureInfo | culture | Culture to get the value in. |

#### Returns

| Type | Description |
| --- | --- |
| T | The original value of the property. Returns default `T` when the property is not dirty. |

#### Type Parameters

| Name | Description |
| --- | --- |
| T | Type of the value. Should preferably be nullable. |

### GetOriginalPropertyValue<T>(string)

Gets the original value of a property. `T` should preferably be nullable.

#### Declaration

```csharp
T GetOriginalPropertyValue<T>(string propertyName)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | propertyName | Name of the property (case-insensitive). |

#### Returns

| Type | Description |
| --- | --- |
| T | The original value of the property. Returns default `T` when the property is not dirty. |

#### Type Parameters

| Name | Description |
| --- | --- |
| T | Type of the value. Should preferably be nullable. |

### GetRemovedIds(string, RelationRole?)

Gets the removed ids from the relation. Returns an empty list if there are no ids removed.

#### Declaration

```csharp
IReadOnlyList<long> GetRemovedIds(string relationName, RelationRole? role = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | relationName | Name of the relation (case-insensitive). |
| RelationRole | role | Role of the relation. |

#### Returns

| Type | Description |
| --- | --- |
| IReadOnlyList<>long | A collection of ids. |

### IsPropertyDirty(string)

Checks if the given property is dirty.

#### Declaration

```csharp
bool IsPropertyDirty(string propertyName)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | propertyName | Name of the property (case-insensitive). |

#### Returns

| Type | Description |
| --- | --- |
| bool | Returns true if it is dirty. |

### IsRelationDirty(string, RelationRole?)

Checks if the given relation is dirty.

#### Declaration

```csharp
bool IsRelationDirty(string relationName, RelationRole? role = null)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| string | relationName | Name of the relation (case-insensitive). |
| RelationRole | role | Role of the relation. |

#### Returns

| Type | Description |
| --- | --- |
| bool | Returns true if it is dirty. |
