Skip to content

Commit

Permalink
GetSimpleDisplayText: explain how it works (#40065)
Browse files Browse the repository at this point in the history
Add a `remarks` section with an explanation.  The explanation is high-level and does not convey all the gory details.
  • Loading branch information
yecril71pl authored Feb 8, 2022
1 parent 3b8ce27 commit e24ff54
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Mvc/Mvc.ViewFeatures/src/ModelExplorerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ public static class ModelExplorerExtensions
/// </summary>
/// <param name="modelExplorer">The <see cref="ModelExplorer"/>.</param>
/// <returns>A simple display string for the model.</returns>
/// <remarks>
/// The result is obtained from the following sources (the first success wins):
/// <see cref="P:Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.SimpleDisplayProperty" />,
/// <see cref="ModelExplorer.Model" /> converted to string (if the result is interesting),
/// the first internal property converted to string,
/// <see cref="P:Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.NullDisplayText" />
/// (when the value is <see langword="null" />).
/// This method is not recursive in order to prevent an infinite loop.
/// </remarks>
public static string GetSimpleDisplayText(this ModelExplorer modelExplorer)
{
if (modelExplorer == null)
Expand Down

0 comments on commit e24ff54

Please sign in to comment.