A
Adrian T.
I have two simple tables that are linked by a foreign key. When I add
the tables to the EDM using the wizard there is the association and
naviagtion properties that I would expect to see are not there. Below
is the script that I am using to create the database tables.
------------------------------------------------------------------------------------------------------------
CREATE TABLE [dbo].[ItemGroups](
[CompanyId] [int] NOT NULL,
[ItemGroupId] [smallint] NOT NULL,
[ItemGroupName] [nvarchar](30) NOT NULL,
CONSTRAINT [PK_ItemGroups] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC,
[ItemGroupId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Items](
[CompanyId] [int] NOT NULL,
[ItemId] [int] NOT NULL,
[ItemName] [nvarchar](40) NOT NULL,
[ItemGroupId] [smallint] NOT NULL,
CONSTRAINT [PK_Items] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC,
[ItemId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Items] WITH CHECK ADD CONSTRAINT
[FK_Items_ItemGroups] FOREIGN KEY([CompanyId], [ItemGroupId])
REFERENCES [dbo].[ItemGroups] ([CompanyId], [ItemGroupId])
GO
the tables to the EDM using the wizard there is the association and
naviagtion properties that I would expect to see are not there. Below
is the script that I am using to create the database tables.
------------------------------------------------------------------------------------------------------------
CREATE TABLE [dbo].[ItemGroups](
[CompanyId] [int] NOT NULL,
[ItemGroupId] [smallint] NOT NULL,
[ItemGroupName] [nvarchar](30) NOT NULL,
CONSTRAINT [PK_ItemGroups] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC,
[ItemGroupId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Items](
[CompanyId] [int] NOT NULL,
[ItemId] [int] NOT NULL,
[ItemName] [nvarchar](40) NOT NULL,
[ItemGroupId] [smallint] NOT NULL,
CONSTRAINT [PK_Items] PRIMARY KEY CLUSTERED
(
[CompanyId] ASC,
[ItemId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY
= OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Items] WITH CHECK ADD CONSTRAINT
[FK_Items_ItemGroups] FOREIGN KEY([CompanyId], [ItemGroupId])
REFERENCES [dbo].[ItemGroups] ([CompanyId], [ItemGroupId])
GO