Skip to main content

Definition

Assembly: Microsoft.Restier.Core.dll Namespace: Microsoft.Restier.Core.Model

Syntax

Microsoft.Restier.Core.Model.IModelMapper

Summary

Represents a service that maps between the model space and the object space.

Methods

TryGetRelevantType Abstract

Tries to get the relevant type of an entity set, singleton, or composable function import.

Syntax

bool TryGetRelevantType(Microsoft.Restier.Core.Model.ModelContext context, string name, out System.Type relevantType)

Parameters

NameTypeDescription
contextMicrosoft.Restier.Core.Model.ModelContextThe context for model mapper.
namestringThe name of an entity set, singleton or composable function import.
relevantTypeSystem.TypeWhen this method returns, provides the
relevant type of the queryable source.

Returns

Type: bool true if the relevant type was provided; otherwise, false.

Remarks

For entity sets, the relevant type is its element entity type. For singletons, the relevant type is the singleton entity type. For composable function imports, the relevant type is the return type if it is a primitive, complex or entity type, or the element type of the return type if it is a collection type. This method can return true and assign null as the relevant type when it is overriding a previously registered service and specifically opting to not support the specified queryable source.

TryGetRelevantType Abstract

Tries to get the relevant type of a composable function.

Syntax

bool TryGetRelevantType(Microsoft.Restier.Core.Model.ModelContext context, string namespaceName, string name, out System.Type relevantType)

Parameters

NameTypeDescription
contextMicrosoft.Restier.Core.Model.ModelContextThe context for model mapper.
namespaceNamestringThe name of a namespace containing a composable function.
namestringThe name of composable function.
relevantTypeSystem.TypeWhen this method returns, provides the
relevant type of the composable function.

Returns

Type: bool true if the relevant type was provided; otherwise, false.

Remarks

For composable functions, the relevant type is the return type if it is a primitive, complex or entity type, or the element type of the return type if it is a collection type. This method can return true and assign null as the relevant type when it is overriding a previously registered service and specifically opting to not support the specified composable function.