我有这些表:
CREATE TABLE [EDR_SECURITY].[Person](
[ixPerson] [bigint] IDENTITY(1,1) NOT NULL,
[sName] [nvarchar](200) NOT NULL,
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [EDR_SECURITY].[SecurityGroup](
[ixSecurityGroup] [bigint] IDENTITY(1,1) NOT NULL,
[sName] [nvarchar](200) NOT NULL,
[sDescription] [nvarchar](400) NULL,
) ON [PRIMARY]
CREATE TABLE [EDR_SECURITY].[PersonSecurityGroupDefinition](
[ixPerson] [bigint] NOT NULL,
[ixSecurityGroup] [bigint] NOT NULL,
[fPrivilege] [bigint] NOT NULL,
CONSTRAINT [PK_PersonSecurityGroupDefinition] PRIMARY KEY CLUSTERED
(
[ixPerson] ASC,
[ixSecurityGroup] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
如何在 EF 代码中首先创建 和 之间的Person
关系Security Group
?
谢谢。