EntityDataSourceContextCreatingEventArgs 类      
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为 ContextCreating 事件提供数据。
public ref class EntityDataSourceContextCreatingEventArgs : EventArgs
	public class EntityDataSourceContextCreatingEventArgs : EventArgs
	type EntityDataSourceContextCreatingEventArgs = class
    inherit EventArgs
	Public Class EntityDataSourceContextCreatingEventArgs
Inherits EventArgs
		- 继承
 
示例
以下示例演示对象的变量Page的ObjectContext创建及其对 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属性,该属性可分配给事件的处理程序ContextCreating中长时间运行的 ObjectContext 。 有关详细信息,请参阅 Object Context Life-Cycle Management (EntityDataSource) 。
属性
| Context | 
		 获取数据源使用的 ObjectContext。  | 
        	
方法
| Equals(Object) | 
		 确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回表示当前对象的字符串。 (继承自 Object) |