Dela via


HtmlHelperDisplayNameExtensions.DisplayNameFor<TModelItem,TResult> Method

Definition

Returns the display name for the specified expression if the current model represents a collection.

public:
generic <typename TModelItem, typename TResult>
[System::Runtime::CompilerServices::Extension]
 static System::String ^ DisplayNameFor(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper<System::Collections::Generic::IEnumerable<TModelItem> ^> ^ htmlHelper, System::Linq::Expressions::Expression<Func<TModelItem, TResult> ^> ^ expression);
public static string DisplayNameFor<TModelItem,TResult> (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>> htmlHelper, System.Linq.Expressions.Expression<Func<TModelItem,TResult>> expression);
static member DisplayNameFor : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<seq<'ModelItem>> * System.Linq.Expressions.Expression<Func<'ModelItem, 'Result>> -> string
<Extension()>
Public Function DisplayNameFor(Of TModelItem, TResult) (htmlHelper As IHtmlHelper(Of IEnumerable(Of TModelItem)), expression As Expression(Of Func(Of TModelItem, TResult))) As String

Type Parameters

TModelItem

The type of items in the model collection.

TResult

The type of the expression result.

Parameters

htmlHelper
IHtmlHelper<IEnumerable<TModelItem>>

The IHtmlHelper<TModel> of IEnumerable<T> instance this method extends.

expression
Expression<Func<TModelItem,TResult>>

An expression to be evaluated against an item in the current model.

Returns

A String containing the display name.

Applies to