// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Mvc.Rendering
{
///
/// DisplayName-related extensions for and .
///
public static class HtmlHelperDisplayNameExtensions
{
///
/// Returns the display name for the current model.
///
/// The instance this method extends.
/// A containing the display name.
public static string DisplayNameForModel([NotNull] this IHtmlHelper htmlHelper)
{
return htmlHelper.DisplayName(expression: null);
}
///
/// Returns the display name for the specified
/// if the current model represents a collection.
///
///
/// The instance this method extends.
///
/// An expression to be evaluated against an item in the current model.
/// The type of items in the model collection.
/// The type of the result.
/// A containing the display name.
public static string DisplayNameFor(
[NotNull] this IHtmlHelper> htmlHelper,
[NotNull] Expression> expression)
{
return htmlHelper.DisplayNameForInnerType(expression);
}
}
}