> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# DataModificationItem

> Represents a data modification item in a change set.

## Definition

**Assembly:** Microsoft.Restier.Core.dll

**Namespace:** Microsoft.Restier.Core.Submit

**Inheritance:** Microsoft.Restier.Core.Submit.DataModificationItem

## Syntax

```csharp theme={"dark"}
Microsoft.Restier.Core.Submit.DataModificationItem<T>
```

## Summary

Represents a data modification item in a change set.

## Type Parameters

* `T` - The resource type.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [DataModificationItem\`1](https://learn.microsoft.com/dotnet/api/microsoft.restier.core.submit.datamodificationitem-1) class.

#### Syntax

```csharp theme={"dark"}
public DataModificationItem(string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.RestierEntitySetOperation action, System.Collections.Generic.IReadOnlyDictionary<string, object> resourceKey, System.Collections.Generic.IReadOnlyDictionary<string, object> originalValues, System.Collections.Generic.IReadOnlyDictionary<string, object> localValues)
```

#### Parameters

| Name                   | Type                                                             | Description                                         |
| ---------------------- | ---------------------------------------------------------------- | --------------------------------------------------- |
| `resourceSetName`      | `string`                                                         | The name of the resource set in question.           |
| `expectedResourceType` | `System.Type`                                                    | The type of the expected resource type in question. |
| `actualResourceType`   | `System.Type`                                                    | The type of the actual resource type in question.   |
| `action`               | `Microsoft.Restier.Core.RestierEntitySetOperation`               | The RestierEntitySetOperations for the request.     |
| `resourceKey`          | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | The key of the resource being modified.             |
| `originalValues`       | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | Any original values of the resource that are known. |
| `localValues`          | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | The local values of the entity.                     |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Initializes a new instance of the [DataModificationItem](/restier/api-reference/Microsoft/Restier/Core/Submit/DataModificationItem) class.

#### Syntax

```csharp theme={"dark"}
public DataModificationItem(string resourceSetName, System.Type expectedResourceType, System.Type actualResourceType, Microsoft.Restier.Core.RestierEntitySetOperation action, System.Collections.Generic.IReadOnlyDictionary<string, object> resourceKey, System.Collections.Generic.IReadOnlyDictionary<string, object> originalValues, System.Collections.Generic.IReadOnlyDictionary<string, object> localValues)
```

#### Parameters

| Name                   | Type                                                             | Description                                         |
| ---------------------- | ---------------------------------------------------------------- | --------------------------------------------------- |
| `resourceSetName`      | `string`                                                         | The name of the resource set in question.           |
| `expectedResourceType` | `System.Type`                                                    | The type of the expected resource type in question. |
| `actualResourceType`   | `System.Type`                                                    | The type of the actual resource type in question.   |
| `action`               | `Microsoft.Restier.Core.RestierEntitySetOperation`               | The RestierEntitySetOperations for the request.     |
| `resourceKey`          | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | The key of the resource being modified.             |
| `originalValues`       | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | Any original values of the resource that are known. |
| `localValues`          | `System.Collections.Generic.IReadOnlyDictionary<string, object>` | The local values of the resource.                   |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem`</Note>

#### Syntax

```csharp theme={"dark"}
internal ChangeSetItem(Microsoft.Restier.Core.Submit.ChangeSetItemType type)
```

#### Parameters

| Name   | Type                                              | Description |
| ------ | ------------------------------------------------- | ----------- |
| `type` | `Microsoft.Restier.Core.Submit.ChangeSetItemType` | -           |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ActualResourceType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the name of the actual resource type in question.
In type inheritance case, this is different from expectedResourceType

#### Syntax

```csharp theme={"dark"}
public System.Type ActualResourceType { get; private set; }
```

#### Property Value

Type: `System.Type`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ChangeSetItemProcessingStage <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem`</Note>

Gets or sets the dynamic state of this change set item.

#### Syntax

```csharp theme={"dark"}
internal Microsoft.Restier.Core.Submit.ChangeSetItemProcessingStage ChangeSetItemProcessingStage { get; set; }
```

#### Property Value

Type: `Microsoft.Restier.Core.Submit.ChangeSetItemProcessingStage`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> EntitySetOperation <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets or sets the action to be taken.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Restier.Core.RestierEntitySetOperation EntitySetOperation { get; set; }
```

#### Property Value

Type: `Microsoft.Restier.Core.RestierEntitySetOperation`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ExpectedResourceType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the name of the expected resource type in question.

#### Syntax

```csharp theme={"dark"}
public System.Type ExpectedResourceType { get; private set; }
```

#### Property Value

Type: `System.Type`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> IsFullReplaceUpdateRequest <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets or sets a value indicating whether the resource should be fully replaced by the modification.

#### Syntax

```csharp theme={"dark"}
public bool IsFullReplaceUpdateRequest { get; set; }
```

#### Property Value

Type: `bool`

#### Remarks

If true, all properties will be updated, even if the property isn't in LocalValues.
If false, only properties identified in LocalValues will be updated on the resource.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> LocalValues <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the local values for properties that have changed.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyDictionary<string, object> LocalValues { get; private set; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyDictionary<string, object>`

#### Remarks

For entities pending deletion, this property is `null`.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> OriginalValues <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the original values for properties that have changed.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyDictionary<string, object> OriginalValues { get; private set; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyDictionary<string, object>`

#### Remarks

For new entities, this property is `null`.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Resource

Gets or sets the resource object in question.

#### Syntax

```csharp theme={"dark"}
public T Resource { get; set; }
```

#### Property Value

Type: `T`

#### Remarks

Initially this will be `null`, however after the change
set has been prepared it will represent the pending resource.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Resource <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets or sets the resource object in question.

#### Syntax

```csharp theme={"dark"}
public object Resource { get; set; }
```

#### Property Value

Type: `object`

#### Remarks

Initially this will be `null`, however after the change
set has been prepared it will represent the pending resource.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ResourceKey <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the key of the resource being modified.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyDictionary<string, object> ResourceKey { get; private set; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyDictionary<string, object>`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ResourceSetName <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the name of the resource set in question.

#### Syntax

```csharp theme={"dark"}
public string ResourceSetName { get; private set; }
```

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ServerValues <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Gets the current server values for properties that have changed.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IReadOnlyDictionary<string, object> ServerValues { get; private set; }
```

#### Property Value

Type: `System.Collections.Generic.IReadOnlyDictionary<string, object>`

#### Remarks

For new entities, this property is `null`. For updated
entities, it is `null` until the change set is prepared.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Type <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem`</Note>

Gets the type of this change set item.

#### Syntax

```csharp theme={"dark"}
internal Microsoft.Restier.Core.Submit.ChangeSetItemType Type { get; private set; }
```

#### Property Value

Type: `Microsoft.Restier.Core.Submit.ChangeSetItemType`

## Methods

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ApplyTo <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Applies the current DataModificationItem's KeyValues and OriginalValues to the
specified query and returns the new query.

#### Syntax

```csharp theme={"dark"}
public System.Linq.IQueryable ApplyTo(System.Linq.IQueryable query)
```

#### Parameters

| Name    | Type                     | Description                                     |
| ------- | ------------------------ | ----------------------------------------------- |
| `query` | `System.Linq.IQueryable` | The IQueryable to apply the property values to. |

#### Returns

Type: `System.Linq.IQueryable`
The new IQueryable with the property values applied to it in a Where condition.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> HasChanged <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.ChangeSetItem`</Note>

Indicates whether this change set item is in a changed state.

#### Syntax

```csharp theme={"dark"}
public bool HasChanged()
```

#### Returns

Type: `bool`
Whether this change set item is in a changed state.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ValidateEtag <Badge color="gray">Inherited</Badge>

<Note>Inherited from `Microsoft.Restier.Core.Submit.DataModificationItem`</Note>

Validate the e-tag via applies the current DataModificationItem's OriginalValues to the
specified query and returns result.

#### Syntax

```csharp theme={"dark"}
public object ValidateEtag(System.Linq.IQueryable query)
```

#### Parameters

| Name    | Type                     | Description                                     |
| ------- | ------------------------ | ----------------------------------------------- |
| `query` | `System.Linq.IQueryable` | The IQueryable to apply the property values to. |

#### Returns

Type: `object`
The object is e-tag checked passed.
