Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Models Inheritance: System.ObjectSyntax
Summary
Represents an action import in an OData entity container.Remarks
Action imports expose actions as addressable resources in the OData service. They allow actions to be called through the service interface, providing custom operations that can have side effects. Actions are typically invoked using POST requests and can modify the state of the service.Constructors
.ctor
Initializes a new instance of the EdmActionImport class.Syntax
.ctor
Initializes a new instance of the EdmActionImport class with the specified name and action.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of the action import. |
action | string | The fully qualified name of the action being imported. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when name or action is null or whitespace. |
.ctor Inherited
Inherited from
objectSyntax
Properties
Action
Gets or sets the fully qualified name of the action being imported.Syntax
Property Value
Type:string
The namespace and name of the action that this import exposes.
Remarks
This references an action defined elsewhere in the model. The action import makes the action accessible as part of the entity container’s interface.Annotations
Gets or sets the annotations for this action import.Syntax
Property Value
Type:System.Collections.Generic.Dictionary<string, object>
A dictionary of annotations that provide additional metadata about the action import.
Remarks
Annotations can be used to specify additional behaviors, constraints, or metadata that are not captured by the standard OData model elements.EntitySet
Gets or sets the entity set associated with this action import.Syntax
Property Value
Type:string?
The name of the entity set, or null if the action doesn’t return entities from a specific set.
Remarks
When the action returns entities, this property specifies which entity set those entities belong to. This is important for establishing the correct context for navigation properties and other operations.Name
Gets or sets the name of the action import.Syntax
Property Value
Type:string
The name used to address this action import in OData URLs.
Remarks
The action import name appears in the URL path when invoking the action.Methods
AddAnnotation
Adds an annotation to this action import.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
term | string | The annotation term. |
value | object | The annotation value. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when term is null or whitespace. |
Equals Override
Determines whether the specified object is equal to the current action import.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | The object to compare with the current action import. |
Returns
Type:bool
true if the specified object is equal to the current action import; otherwise, false.
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetAnnotation
Gets an annotation value by term.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
term | string | The annotation term. |
Returns
Type:T?
The annotation value, or the default value of T if not found.
Type Parameters
T- The type of the annotation value.
GetHashCode Override
Returns a hash code for the current action import.Syntax
Returns
Type:int
A hash code for the current action import.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Override
Returns a string representation of the action import.Syntax
Returns
Type:string
A string containing the action import name and action.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?