ValidationAttributeAdapter<TAttribute>.GetErrorMessage 方法

定義

取得使用 Attribute 格式化的錯誤訊息。

protected:
 virtual System::String ^ GetErrorMessage(Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ modelMetadata, ... cli::array <System::Object ^> ^ arguments);
protected virtual string GetErrorMessage (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata, params object[] arguments);
abstract member GetErrorMessage : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj[] -> string
override this.GetErrorMessage : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj[] -> string
Protected Overridable Function GetErrorMessage (modelMetadata As ModelMetadata, ParamArray arguments As Object()) As String

參數

modelMetadata
ModelMetadata

ModelMetadata 批註為 Attribute 的模型相關聯的 。

arguments
Object[]

將用於建構錯誤訊息的值引數。

傳回

格式化的錯誤字串。

適用於