ModelMethodContext クラス
定義
UpdateModel<TModel>(TModel) オブジェクトに直接アクセスできない場合に、TryUpdateModel<TModel>(TModel) または Page メソッドを呼び出すために使用します。Used to invoke the UpdateModel<TModel>(TModel) or TryUpdateModel<TModel>(TModel) method when the Page object is not directly accessible.
public ref class ModelMethodContext
public class ModelMethodContext
type ModelMethodContext = class
Public Class ModelMethodContext
- 継承
-
ModelMethodContext
注釈
たとえば、カスタムクラスは、データバインディングの、、、およびの各プロパティによって参照されるメソッドを定義できます SelectMethod
UpdateMethod
DeleteMethod
InsertMethod
。また、これらのメソッドは、この型のパラメーターを持つことができ、メソッドを呼び出すために使用でき UpdateModel ます。For example, a custom class can define the methods referred to by the SelectMethod
, UpdateMethod
, DeleteMethod
, and InsertMethod
properties for data binding, and those methods can have a parameter of this type and use it to invoke the UpdateModel method. また、メソッドパラメーターの代わりに、メソッド Current 内でプロパティを使用してメソッドを呼び出すこともでき UpdateModel ます。Alternatively, instead of a method parameter, the Current property can be used within a method to invoke the UpdateModel method.
Web フォームでのモデルバインドの使用に関するチュートリアルシリーズについては、「モデルバインドと Web フォーム」を参照してください。For a tutorial series on using model binding with Web Forms, see Model Binding and Web Forms.
コンストラクター
ModelMethodContext(Page) |
ModelMethodContext クラスの新しいインスタンスを初期化します。Initializes a new instance of the ModelMethodContext class. |
プロパティ
Current |
ModelMethodContext プロパティ内の Page オブジェクトに対応する Current オブジェクトを取得します。Gets the ModelMethodContext object that corresponds to the Page object that is in the Current property. |
ModelState |
モデルの状態を取得します。Gets the model state. |
メソッド
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object. (継承元 Object) |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
ToString() |
現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object. (継承元 Object) |
TryUpdateModel<TModel>(TModel) |
値プロバイダー内の値を使用して、指定されたモデル インスタンスを更新します。Updates the specified model instance using values from a value provider. |
TryUpdateModel<TModel>(TModel, IValueProvider) |
指定された値プロバイダー内の値を使用して、指定されたモデル インスタンスを更新します。Updates the specified model instance using values from the specified value provider. |
UpdateModel<TModel>(TModel) |
値プロバイダー内の値を使用して、指定されたモデル インスタンスを更新します。Updates the specified model instance using values from a value provider. |
UpdateModel<TModel>(TModel, IValueProvider) |
指定された値プロバイダー内の値を使用して、指定されたモデル インスタンスを更新します。Updates the specified model instance using values from the specified value provider. |