EntitySet.Create 方法
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
建構的 EntitySet 物件的 Factory 方法。
命名空間: 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 | 如果 name 引數為 null 或空字串,則擲回。 |
備註
新建立的 EntitySet 將會是唯讀。