ModelExpressionProvider.CreateModelExpression 方法

定义

重载

CreateModelExpression<TModel,TValue>(ViewDataDictionary<TModel>, Expression<Func<TModel,TValue>>)

返回描述 ModelExpression 给定 expression的 实例。

CreateModelExpression<TModel>(ViewDataDictionary<TModel>, String)

返回描述 ModelExpression 给定 expression的 实例。

CreateModelExpression<TModel,TValue>(ViewDataDictionary<TModel>, Expression<Func<TModel,TValue>>)

Source:
ModelExpressionProvider.cs
Source:
ModelExpressionProvider.cs
Source:
ModelExpressionProvider.cs

返回描述 ModelExpression 给定 expression的 实例。

public:
generic <typename TModel, typename TValue>
 virtual 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
override this.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

类型参数

TModel

Model的类型viewData

TValue

结果的类型 expression

参数

viewData
ViewDataDictionary<TModel>

包含ViewDataDictionary<TModel>Model计算所针对的 expression 的 。

expression
Expression<Func<TModel,TValue>>

要针对当前模型计算的表达式。

返回

ModelExpression描述给定 expression的新实例。

实现

适用于

CreateModelExpression<TModel>(ViewDataDictionary<TModel>, String)

Source:
ModelExpressionProvider.cs

返回描述 ModelExpression 给定 expression的 实例。

public:
generic <typename TModel>
 Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExpression ^ CreateModelExpression(Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary<TModel> ^ viewData, System::String ^ expression);
public Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression CreateModelExpression<TModel> (Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TModel> viewData, string expression);
member this.CreateModelExpression : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<'Model> * string -> Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression
Public Function CreateModelExpression(Of TModel) (viewData As ViewDataDictionary(Of TModel), expression As String) As ModelExpression

类型参数

TModel

Model的类型viewData

参数

viewData
ViewDataDictionary<TModel>

包含ViewDataDictionary<TModel>Model计算所针对的 expression 的 。

expression
String

表达式名称,相对于 viewData.Model

返回

ModelExpression描述给定 expression的新实例。

适用于