次の方法で共有


IHtmlGenerator.GetCurrentValues メソッド

定義

指定 expressionした の現在の値のコレクションを取得します。

public:
 System::Collections::Generic::ICollection<System::String ^> ^ GetCurrentValues(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ expression, bool allowMultiple);
public System.Collections.Generic.ICollection<string> GetCurrentValues (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression, bool allowMultiple);
abstract member GetCurrentValues : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * bool -> System.Collections.Generic.ICollection<string>
Public Function GetCurrentValues (viewContext As ViewContext, modelExplorer As ModelExplorer, expression As String, allowMultiple As Boolean) As ICollection(Of String)

パラメーター

viewContext
ViewContext

現在の ViewContext スコープのインスタンス。

modelExplorer
ModelExplorer

ModelExplorer の場合は expression。 の場合nullは、 を使用して結果をEval(String)計算しますexpression

expression
String

現在のモデルを基準とした式名。

allowMultiple
Boolean

の場合 trueは、コレクション expression の結果が必要です。 それ以外の場合は、結果を 1 つの値として扱います。

戻り値

null 結果が見つからない expression 場合は 。 それ以外の場合は、 ICollection<T> 指定された expressionの現在の値を含む 。

結果を expressionString変換します。 その結果が型の IEnumerable 場合は、代わりにコレクション内の各項目を変換し、それらを個別に返します。

expression結果または要素型が のEnum場合は、値の整数表現と、その値のすべてのEnum名前をEnum含む を返Stringします。 それ以外の場合は、値の既定 String の変換を返します。

注釈

戻り値の使用方法については、以下を参照してください GenerateSelect

適用対象