ReferentialConstraint 构造函数
[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]
在该关系上构造一个新约束
命名空间: System.Data.Entity.Core.Metadata.Edm
程序集: EntityFramework(在 EntityFramework.dll 中)
语法
声明
Public Sub New ( _
fromRole As RelationshipEndMember, _
toRole As RelationshipEndMember, _
fromProperties As IEnumerable(Of EdmProperty), _
toProperties As IEnumerable(Of EdmProperty) _
)
用法
Dim fromRole As RelationshipEndMember
Dim toRole As RelationshipEndMember
Dim fromProperties As IEnumerable(Of EdmProperty)
Dim toProperties As IEnumerable(Of EdmProperty)
Dim instance As New ReferentialConstraint(fromRole, _
toRole, fromProperties, toProperties)
public ReferentialConstraint(
RelationshipEndMember fromRole,
RelationshipEndMember toRole,
IEnumerable<EdmProperty> fromProperties,
IEnumerable<EdmProperty> toProperties
)
public:
ReferentialConstraint(
RelationshipEndMember^ fromRole,
RelationshipEndMember^ toRole,
IEnumerable<EdmProperty^>^ fromProperties,
IEnumerable<EdmProperty^>^ toProperties
)
new :
fromRole:RelationshipEndMember *
toRole:RelationshipEndMember *
fromProperties:IEnumerable<EdmProperty> *
toProperties:IEnumerable<EdmProperty> -> ReferentialConstraint
public function ReferentialConstraint(
fromRole : RelationshipEndMember,
toRole : RelationshipEndMember,
fromProperties : IEnumerable<EdmProperty>,
toProperties : IEnumerable<EdmProperty>
)
参数
- fromRole
类型:System.Data.Entity.Core.Metadata.Edm.RelationshipEndMember
该关系源自的角色
- toRole
类型:System.Data.Entity.Core.Metadata.Edm.RelationshipEndMember
该关系链接到/针对的角色
- fromProperties
类型:System.Collections.Generic.IEnumerable<EdmProperty>
参与约束的目标角色的实体类型上的属性
- toProperties
类型:System.Collections.Generic.IEnumerable<EdmProperty>
参与约束的源角色的实体类型上的属性
异常
例外 | 条件 |
---|---|
ArgumentNullException | 如果任何参数为 null,则引发参数 Null 异常 |