From a2420688ff7b4cd73b891e8e9d91655def5d5089 Mon Sep 17 00:00:00 2001 From: Fabien Lavocat Date: Mon, 5 Feb 2018 10:54:55 -0800 Subject: [PATCH] Add comments and remove default values in the contructor --- .../Rendering/SelectListItem.cs | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs index af32345074..bca0dd88e7 100644 --- a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs +++ b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Rendering/SelectListItem.cs @@ -10,14 +10,35 @@ namespace Microsoft.AspNetCore.Mvc.Rendering /// public class SelectListItem { + /// + /// Initializes a new instance of . + /// public SelectListItem() { } - public SelectListItem(string text, string value, bool selected = false, bool disabled = false) + /// + /// Initializes a new instance of . + /// + /// The display text of this . + /// The value of this . + public SelectListItem(string text, string value) + : this() + { + Text = text; + Value = value; + } + + /// + /// Initializes a new instance of . + /// + /// The display text of this . + /// The value of this . + /// Value that indicates whether this is selected. + /// Value that indicates whether this is disabled. + public SelectListItem(string text, string value, bool selected, bool disabled) + : this(text, value) { Disabled = disabled; Selected = selected; - Text = text; - Value = value; } ///