英語で読む

次の方法で共有


EntityDataSourceContextCreatingEventArgs クラス

定義

ContextCreating イベントのデータを提供します。

C#
public class EntityDataSourceContextCreatingEventArgs : EventArgs
継承
EntityDataSourceContextCreatingEventArgs

次の例は、 オブジェクトの変数の ObjectContext 作成と、 オブジェクトの Page プロパティへの Context 代入を EntityDataSourceContextCreatingEventArgs 示しています。

public partial class _Default : System.Web.UI.Page  
    {  
        AdventureWorksModel.AdventureWorksEntities objCtx =  
            new AdventureWorksModel.AdventureWorksEntities();  

        protected void EntityDataSource2_ContextCreating(object sender,   
            EntityDataSourceContextCreatingEventArgs e)  
        {  
            e.Context = objCtx;  
        }  
    }  

注釈

EntityDataSourceContextCreatingEventArgsオブジェクトには、 イベントのContextハンドラーで実行ObjectContext時間の長い に割り当てることができる プロパティがありますContextCreating。 詳細については、「 オブジェクト コンテキスト Life-Cycle管理 (EntityDataSource)」を参照してください。

プロパティ

Context

データ ソースが使用する ObjectContext を取得します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

製品 バージョン
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1