Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ModelMetadata.FromLambdaExpression(Of TParameter, TValue) Method

Returns the metadata from the Expression parameter for the model.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

'Declaration
Public Shared Function FromLambdaExpression(Of TParameter, TValue) ( _
	expression As Expression(Of Func(Of TParameter, TValue)), _
	viewData As ViewDataDictionary(Of TParameter) _
) As ModelMetadata
'Usage
Dim expression As Expression(Of Func(Of TParameter, TValue))
Dim viewData As ViewDataDictionary(Of TParameter)
Dim returnValue As ModelMetadata 

returnValue = ModelMetadata.FromLambdaExpression(expression, _
	viewData)

Type Parameters

TParameter

The type of the parameter.

TValue

The type of the value.

Parameters

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TParameter, TValue))

An expression that identifies the model.

viewData
Type: System.Web.Mvc.ViewDataDictionary(Of TParameter)

The view data dictionary.

Return Value

Type: System.Web.Mvc.ModelMetadata
The metadata.

This method is called by templated helpers to get model metadata. For more information, see Walkthrough: Using Templated Helpers to Display Data.

Show:
© 2015 Microsoft