MetadataWorkspaceExtensions 类
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
用于 MetadataWorkspace API 的扩展方法
继承层次结构
System.Object
Microsoft.Data.Entity.Design.DatabaseGeneration.MetadataWorkspaceExtensions
命名空间: Microsoft.Data.Entity.Design.DatabaseGeneration
程序集: Microsoft.Data.Entity.Design.DatabaseGeneration(在 Microsoft.Data.Entity.Design.DatabaseGeneration.dll 中)
语法
声明
<ExtensionAttribute> _
Public NotInheritable Class MetadataWorkspaceExtensions
用法
public static class MetadataWorkspaceExtensions
[ExtensionAttribute]
public ref class MetadataWorkspaceExtensions abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type MetadataWorkspaceExtensions = class end
public final class MetadataWorkspaceExtensions
MetadataWorkspaceExtensions 类型公开以下成员。
方法
名称 | 描述 | |
---|---|---|
GetAllAssociations | 检索此 ItemCollection 中所有 AssociationType 元素的可枚举集合 | |
GetAllAssociationSets | 检索此 ItemCollection 中所有 AssociationSet 元素的可枚举集合 | |
GetAllEntitySets | 检索此 ItemCollection 中所有 EntitySet 元素的可枚举集合 | |
GetAllEntityTypes | 检索此 ItemCollection 中所有 EntityType 元素的可枚举集合 | |
GetAllReferentialConstraints | 检索此 SSDL/StoreItemCollection 中所有 ReferentialConstraints 的可枚举集合 | |
GetAssociation | 返回 AssociationSet 中的关联 | |
GetContainingTypes | 获取此 EntitySet 内的所有 EntityTypes | |
GetDependentEnd | 考虑到优先级顺序为 1 的以下规则,检索此关联的依赖端。如果存在针对关联定义的引用约束,将返回 DependentEnd。2.如果关联的多重性为 1:1 并且对第一个关联端定义了 OnDelete='Cascade',则返回另一个关联端。如果没有对第一个关联端定义 OnDelete='Cascade',则返回第一个关联端。3.在 1:* 或 0..1:* 关联中,这将返回以 * 多重性结尾的关联端。4.在 0..1:1 关联中,这将返回以 0..1 多重性结尾的关联端。 | |
GetDependentProperty | 如果这是参与引用约束的主体端的属性,则此方法将返回依赖端上的相应属性。 | |
GetEnd1 | 返回指定 AssociationType 的 AssociationEndMembers 属性中的第一个 AssociationEndMember。 | |
GetEnd2 | 返回指定 AssociationType 的 AssociationEndMembers 属性中的第二个 AssociationEndMember。 | |
GetEntityContainerName | 检索此 ItemCollection 中 &lt;EntityContainer/&gt; 元素的“Name”特性。 | |
GetEntityType | 检索 AssociationEnd 上的 EntityType。 | |
GetKeyProperties(AssociationEndMember) | 获取直接在 AssociationEnd 内的 EntityType 上声明的键属性 | |
GetKeyProperties(EntityType) | 获取直接在 EntityType 上声明的键属性 | |
GetNamespace | 通过检查首先找到的 StructuralType 检索此 ItemCollection 的命名空间 | |
GetOnDelete | 这将获取 AssociationEnd 1 上 OnDelete 元素的值。如果该端和其同级端将“Cascade”指定为 2,将返回“None”。如果该端的多重性为 Many (*),将返回“None” | |
GetOtherEnd | 假定此关联的 AssociationEndMember,则此方法将返回参与关联的其他端 | |
GetPrincipalEnd | 检索此关联的主体端 | |
GetRootOrSelf | 在没有基类型时返回此 EntityType。否则,返回最顶层的基类型。 | |
GetSchemaName | 为此 EntitySet 检索架构名称,存储在其 MetadataProperties 中 | |
GetStoreGeneratedPatternValue | 在提供目标版本和 DataSpace 的情况下,获取 EdmProperty 的 StoreGeneratedPattern 值 | |
GetStoreType | 通过 DbProviderManifest 从 EdmMember 的 EdmType 获取 StoreType | |
GetTableName | 为此 EntitySet 检索表名称,存储在其 MetadataProperties 中 | |
InferSsdlFacetsForCsdlProperty | 从 CSDL 属性推断 SSDL 方面 | |
IsComplexProperty | 确定此属性是否为 ComplexProperty;也就是说,其类型是否为 ComplexType | |
IsDerivedType | 确定指定实体类型是否为派生类型。 | |
IsJoinTable | 如果为 :1 时,我们可推断某个表是 SSDL 中的连接表。有两个源自该表的关联 2.表上的两个端是 * 3.关联上的其他端是 1 4.表中的属性数等于两个关联的其他端上所有键属性的总和 5.表中的所有属性都为键属性 | |
IsManyToMany | 确定某个关联的多重性是否为 *:* | |
IsPKToPK | 确定某个关联是否只跨主键 | |
ToStoreType | 将某一 EDM 类型转换为 SQL 类型,并且考虑方面。请注意,在从 DbProviderManifest (FixedLength, Unicode) 获取某些方面时已考虑这些方面 |
顶部
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。