Skip to main content

Definition

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

Syntax

Summary

Answers four questions about an OData service with three requests: is $metadata reachable, is the data reachable, is either of them secured, and does a real row look like the model says it should.

Remarks

The probe uses whatever HttpClient it is given. Pass a plain client to learn what an anonymous caller sees; pass the authenticated OData client to learn what the catalog will see. It never throws for a service that misbehaves; every failure lands in a ProbeStep.

Examples

Constructors

.ctor

Initializes a new instance of the ServiceProbe class.

Syntax

Parameters

.ctor Inherited

Inherited from object

Syntax

Methods

ChooseEntitySet

Picks the entity set to sample: the first one the container declares whose type the model resolves.

Syntax

Parameters

Returns

Type: System.Nullable<(Microsoft.OData.Mcp.Core.Models.EdmEntitySet, Microsoft.OData.Mcp.Core.Models.EdmEntityType)> The set and its type, or null when the model declares no usable set.

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

InterpretRow

Checks a data response body against the model: is it JSON, is it an OData collection, and do the first row’s property names belong to the type.

Syntax

Parameters

Returns

Type: Microsoft.OData.Mcp.Core.Diagnostics.ProbeStep ProbeOutcome.Passed when the row’s properties are declared on the type (an empty set also passes, with a note); ProbeOutcome.Unreadable when the body is not JSON, has no value array, or shares no property names with the type.

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ProbeAsync

Runs all three steps.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult> The result. Never throws for a misbehaving service.

ProbeWithModelAsync

Runs steps 2 and 3 against a model that is already parsed, for hosts that fetched $metadata themselves.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<Microsoft.OData.Mcp.Core.Diagnostics.ServiceProbeResult> A result whose metadata step is recorded as passed.

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?