EntitySet.Create 方法
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
构造该 EntitySet 对象的工厂方法。
命名空间: System.Data.Entity.Core.Metadata.Edm
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Shared Function Create ( _
name As String, _
schema As String, _
table As String, _
definingQuery As String, _
entityType As EntityType, _
metadataProperties As IEnumerable(Of MetadataProperty) _
) As EntitySet
用法
Dim name As String
Dim schema As String
Dim table As String
Dim definingQuery As String
Dim entityType As EntityType
Dim metadataProperties As IEnumerable(Of MetadataProperty)
Dim returnValue As EntitySet
returnValue = EntitySet.Create(name, schema, _
table, definingQuery, entityType, _
metadataProperties)
public static EntitySet Create(
string name,
string schema,
string table,
string definingQuery,
EntityType entityType,
IEnumerable<MetadataProperty> metadataProperties
)
public:
static EntitySet^ Create(
String^ name,
String^ schema,
String^ table,
String^ definingQuery,
EntityType^ entityType,
IEnumerable<MetadataProperty^>^ metadataProperties
)
static member Create :
name:string *
schema:string *
table:string *
definingQuery:string *
entityType:EntityType *
metadataProperties:IEnumerable<MetadataProperty> -> EntitySet
public static function Create(
name : String,
schema : String,
table : String,
definingQuery : String,
entityType : EntityType,
metadataProperties : IEnumerable<MetadataProperty>
) : EntitySet
参数
- name
类型:System.String
EntitySet 的名称。
- schema
类型:System.String
db 架构。 可以为 null。
- table
类型:System.String
db 表。 可以为 null。
- definingQuery
类型:System.String
应该用于检索此 EntitySet 的数据的提供程序特定的查询。 可以为 null。
- entityType
类型:System.Data.Entity.Core.Metadata.Edm.EntityType
此实体集类型包含的实体的实体类型。
- metadataProperties
类型:System.Collections.Generic.IEnumerable<MetadataProperty>
将添加到新创建的 EntitySet 的元数据属性。 可以为 null。
返回值
类型:System.Data.Entity.Core.Metadata.Edm.EntitySet
EntitySet 对象。
异常
例外 | 条件 |
---|---|
ArgumentException | 在名称参数为 null 或是空字符串时引发。 |
备注
新创建的 EntitySet 是只读的。