ObjectContext.CreateObject<T> 方法

定义

创建并返回所请求类型的实例。

public virtual T CreateObject<T> () where T : class;
abstract member CreateObject : unit -> 'T (requires 'T : null)
override this.CreateObject : unit -> 'T (requires 'T : null)
Public Overridable Function CreateObject(Of T As Class) () As T

类型参数

T

要返回的对象的类型。

返回

T

请求的类型 T 的实例,或使 T 可用于实体框架的派生类型的实例。 返回的对象是所请求类型的实例或使得请求的类型能够与 Entity Framework 一起使用的派生类型的实例。

适用于