HtmlHelperDisplayNameExtensions.DisplayNameFor<TModelItem,TResult> Method

Definition

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

C#
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);

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

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0