Share via


IModelExpressionProvider.CreateModelExpression<TModel,TValue> Method

Definition

Returns a ModelExpression instance describing the given expression.

public:
generic <typename TModel, typename TValue>
 Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExpression ^ CreateModelExpression(Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary<TModel> ^ viewData, System::Linq::Expressions::Expression<Func<TModel, TValue> ^> ^ expression);
public Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression CreateModelExpression<TModel,TValue> (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TModel> viewData, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression);
abstract member CreateModelExpression : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> -> Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression
Public Function CreateModelExpression(Of TModel, TValue) (viewData As ViewDataDictionary(Of TModel), expression As Expression(Of Func(Of TModel, TValue))) As ModelExpression

Type Parameters

TModel

The type of the viewData's Model.

TValue

The type of the expression result.

Parameters

viewData
ViewDataDictionary<TModel>

The ViewDataDictionary<TModel> containing the Model against which expression is evaluated.

expression
Expression<Func<TModel,TValue>>

An expression to be evaluated against the current model.

Returns

A new ModelExpression instance describing the given expression.

Applies to