Table of Contents

Interface IPropertyMapper

Namespace
System.Web.Http.OData.Query
Assembly
System.Web.Http.OData.dll

The result of a $select and $expand projection is represented as an ISelectExpandWrapper instance. That instance can be projected into an IDictionary<TKey, TValue> instance by calling ToDictionary(Func<IEdmModel, IEdmStructuredType, IPropertyMapper>). That method will use the function to construct an IPropertyMapper that will map the property names in that projection to the keys in the returned IDictionary<TKey, TValue>. The main purpose of converting an ISelectExpandWrapper instance into an IDictionary<TKey, TValue> (using the method mentioned above) is to allow changing the names of the properties in the Microsoft.Data.Edm.IEdmStructuredType that will be used during the serialization of the $select and $expand projection by a given formatter. For example, to support custom serialization attributes of a particular formatter.

public interface IPropertyMapper

Methods

MapProperty(string)

Defines a mapping between the name of an Microsoft.Data.Edm.IEdmProperty of an Microsoft.Data.Edm.IEdmStructuredType and the name that should be used in other contexts, for example, when projecting an instance of an ISelectExpandWrapper into an instance of an IDictionary<TKey, TValue>

string MapProperty(string propertyName)

Parameters

propertyName string

The name of the property in the Microsoft.Data.Edm.IEdmStructuredType represented by this instance of ISelectExpandWrapper.

Returns

string

The value that will be used as the key for this property in the IDictionary<TKey, TValue> resulting from calling ToDictionary on an ISelectExpandWrapper instance.