Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Models Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.Core.Models.EdmActionImport

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

public EdmActionImport()

.ctor

Initializes a new instance of the EdmActionImport class with the specified name and action.

Syntax

public EdmActionImport(string name, string action)

Parameters

NameTypeDescription
namestringThe name of the action import.
actionstringThe fully qualified name of the action being imported.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when name or action is null or whitespace.

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Action

Gets or sets the fully qualified name of the action being imported.

Syntax

public required string Action { get; set; }

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

public System.Collections.Generic.Dictionary<string, object> Annotations { get; set; }

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

public string EntitySet { get; set; }

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

public required string Name { get; set; }

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

public void AddAnnotation(string term, object value)

Parameters

NameTypeDescription
termstringThe annotation term.
valueobjectThe annotation value.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when term is null or whitespace.

Equals Override

Determines whether the specified object is equal to the current action import.

Syntax

public override bool Equals(object obj)

Parameters

NameTypeDescription
objobject?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 object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetAnnotation

Gets an annotation value by term.

Syntax

public T GetAnnotation<T>(string term)

Parameters

NameTypeDescription
termstringThe 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

public override int GetHashCode()

Returns

Type: int A hash code for the current action import.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Override

Returns a string representation of the action import.

Syntax

public override string ToString()

Returns

Type: string A string containing the action import name and action.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?