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

# EntityScopeRequirements

> Defines scope requirements for operations on a specific entity type.

export function DocsBadge({text, variant = 'neutral'}) {
  const variantClasses = {
    success: 'mint-bg-green-500/10 mint-text-green-600 dark:mint-text-green-400 mint-border-green-500/20',
    neutral: 'mint-bg-slate-500/10 mint-text-slate-600 dark:mint-text-slate-400 mint-border-slate-500/20',
    info: 'mint-bg-blue-500/10 mint-text-blue-600 dark:mint-text-blue-400 mint-border-blue-500/20',
    warning: 'mint-bg-amber-500/10 mint-text-amber-600 dark:mint-text-amber-400 mint-border-amber-500/20',
    danger: 'mint-bg-red-500/10 mint-text-red-600 dark:mint-text-red-400 mint-border-red-500/20'
  };
  const classes = variantClasses[variant] || variantClasses.neutral;
  return <span className={`mint-inline-flex mint-items-center mint-px-2 mint-py-0.5 mint-rounded-full mint-text-xs mint-font-medium mint-tracking-wide mint-border mint-ml-1.5 mint-align-middle mint-whitespace-nowrap ${classes}`}>
      {text}
    </span>;
}

## Definition

**Assembly:** Microsoft.OData.Mcp.Authentication.dll

**Namespace:** Microsoft.OData.Mcp.Authentication.Models

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Authentication.Models.EntityScopeRequirements
```

## Summary

Defines scope requirements for operations on a specific entity type.

## Remarks

Entity scope requirements allow fine-grained authorization control at the
entity level, enabling different access policies for different types of
data within the same OData service.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class.

#### Syntax

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class with the same scopes for all operations.

#### Syntax

```csharp theme={"dark"}
public EntityScopeRequirements(System.Collections.Generic.IEnumerable<string> allOperationsScopes)
```

#### Parameters

| Name                  | Type                                             | Description                                            |
| --------------------- | ------------------------------------------------ | ------------------------------------------------------ |
| `allOperationsScopes` | `System.Collections.Generic.IEnumerable<string>` | The scopes required for all operations on this entity. |

#### Exceptions

| Exception               | Description                                |
| ----------------------- | ------------------------------------------ |
| `ArgumentNullException` | Thrown when *allOperationsScopes* is null. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor

Initializes a new instance of the [EntityScopeRequirements](/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Models/EntityScopeRequirements) class with separate read and write scopes.

#### Syntax

```csharp theme={"dark"}
public EntityScopeRequirements(System.Collections.Generic.IEnumerable<string> readScopes, System.Collections.Generic.IEnumerable<string> writeScopes)
```

#### Parameters

| Name          | Type                                             | Description                               |
| ------------- | ------------------------------------------------ | ----------------------------------------- |
| `readScopes`  | `System.Collections.Generic.IEnumerable<string>` | The scopes required for read operations.  |
| `writeScopes` | `System.Collections.Generic.IEnumerable<string>` | The scopes required for write operations. |

#### Exceptions

| Exception               | Description                                        |
| ----------------------- | -------------------------------------------------- |
| `ArgumentNullException` | Thrown when *readScopes* or *writeScopes* is null. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  .ctor <DocsBadge text="Inherited" variant="neutral" />

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

#### Syntax

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

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  CreateScopes

Gets or sets the scopes required for creating entities of this type.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> CreateScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow create access to the entity.

#### Remarks

Users must have at least one of these scopes to create new instances
of this entity type.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  CustomOperationScopes

Gets or sets custom scope requirements for specific operations.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> CustomOperationScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>>`
A mapping of custom operation names to their required scopes.

#### Remarks

This allows defining scope requirements for custom operations beyond
the standard CRUD operations. The operation names should match those
used in the MCP tool definitions.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  DeleteScopes

Gets or sets the scopes required for deleting entities of this type.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> DeleteScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow delete access to the entity.

#### Remarks

Users must have at least one of these scopes to delete instances
of this entity type.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  NavigateScopes

Gets or sets the scopes required for navigating to related entities.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> NavigateScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow navigation to related entities.

#### Remarks

Users must have at least one of these scopes to follow navigation
properties from this entity type to related entities.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  QueryScopes

Gets or sets the scopes required for querying entities of this type.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> QueryScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow query access to the entity.

#### Remarks

Users must have at least one of these scopes to perform complex
queries, filtering, and sorting on this entity type.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ReadScopes

Gets or sets the scopes required for reading entities of this type.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> ReadScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow read access to the entity.

#### Remarks

Users must have at least one of these scopes to query, retrieve, or
navigate to entities of this type.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  UpdateScopes

Gets or sets the scopes required for updating entities of this type.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<string> UpdateScopes { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<string>`
A collection of scopes that allow update access to the entity.

#### Remarks

Users must have at least one of these scopes to modify existing
instances of this entity type.

## Methods

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  AddCustomOperation

Adds a custom operation with its required scopes.

#### Syntax

```csharp theme={"dark"}
public void AddCustomOperation(string operationName, System.Collections.Generic.IEnumerable<string> scopes)
```

#### Parameters

| Name            | Type                                             | Description                            |
| --------------- | ------------------------------------------------ | -------------------------------------- |
| `operationName` | `string`                                         | The name of the custom operation.      |
| `scopes`        | `System.Collections.Generic.IEnumerable<string>` | The required scopes for the operation. |

#### Exceptions

| Exception               | Description                                        |
| ----------------------- | -------------------------------------------------- |
| `ArgumentException`     | Thrown when *operationName* is null or whitespace. |
| `ArgumentNullException` | Thrown when *scopes* is null.                      |

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<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} style={{ paddingRight: '8px' }} />  Equals <DocsBadge text="Inherited" variant="neutral" />

<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="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetAllScopes

Gets all unique scopes defined for this entity across all operations.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<string> GetAllScopes()
```

#### Returns

Type: `System.Collections.Generic.IEnumerable<string>`
A collection of all unique scopes defined for this entity.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetHashCode <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<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} style={{ paddingRight: '8px' }} />  GetScopesForOperation

Gets the required scopes for a specific operation.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<string> GetScopesForOperation(string operation)
```

#### Parameters

| Name        | Type     | Description                                                                           |
| ----------- | -------- | ------------------------------------------------------------------------------------- |
| `operation` | `string` | The operation name (e.g., "read", "create", "update", "delete", "query", "navigate"). |

#### Returns

Type: `System.Collections.Generic.IEnumerable<string>`
The required scopes for the operation, or an empty collection if no specific requirement exists.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  GetType <DocsBadge text="Inherited" variant="neutral" />

<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} style={{ paddingRight: '8px' }} />  HasAnyScopes

Determines whether any scopes are defined for this entity.

#### Syntax

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

#### Returns

Type: `bool`
`true` if any scopes are defined; otherwise, `false`.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  MemberwiseClone <DocsBadge text="Inherited" variant="neutral" />

<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} style={{ paddingRight: '8px' }} />  ReferenceEquals <DocsBadge text="Inherited" variant="neutral" />

<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="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  SetScopesForOperation

Sets the required scopes for a specific operation.

#### Syntax

```csharp theme={"dark"}
public void SetScopesForOperation(string operation, System.Collections.Generic.IEnumerable<string> scopes)
```

#### Parameters

| Name        | Type                                             | Description                            |
| ----------- | ------------------------------------------------ | -------------------------------------- |
| `operation` | `string`                                         | The operation name.                    |
| `scopes`    | `System.Collections.Generic.IEnumerable<string>` | The required scopes for the operation. |

#### Exceptions

| Exception               | Description                                    |
| ----------------------- | ---------------------------------------------- |
| `ArgumentException`     | Thrown when *operation* is null or whitespace. |
| `ArgumentNullException` | Thrown when *scopes* is null.                  |

### <Icon icon="code-merge" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Override" variant="info" />

Returns a string representation of the entity scope requirements.

#### Syntax

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

#### Returns

Type: `string`
A summary of the scope requirements for this entity.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ToString <DocsBadge text="Inherited" variant="neutral" /> <DocsBadge text="Virtual" variant="warning" />

<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} style={{ paddingRight: '8px' }} />  Validate

Validates the entity scope requirements for consistency and completeness.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<string> Validate()
```

#### Returns

Type: `System.Collections.Generic.IEnumerable<string>`
A collection of validation errors, or an empty collection if the requirements are valid.
