Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
I have 2 tables

create table Countries
(
ID bigint not null,
FullName nvarchar(255) not null unique,
constraint PK_Countries_ID primary key (ID)
)
go
create table CountryStates
(
ID bigint not null identity(1,1),
FullName nvarchar(255) not null,
ShortName nvarchar(10) null,
CountryID bigint not null,
constraint PK_CountryStates_ID primary key (ID),
constraint FK_CountryStates_CountryID foreign key (CountryID) references Countries(ID)
)
go

I need to create an Entity that has the following properties
ID (mapped to CountryStates.ID)
Fullname (mapped to CountryStates.FullName)
Shortname (mapped to CountryStates.ShortName)
CountryID (mapped to CountryStates.CountryID or COuntries.ID Whatever for the start)
CountryFullName (mapped to Countries.FullName)

link to studio screen
http://www.avwork.com/misc/MappingScreen.jpg

The error message is on the screen.
I expect the inner join to happen when selecting CountryStates.

Why does it not compile?

modified on Thursday, July 9, 2009 1:02 PM
Posted

Your link to the screen image doesn't work.
 
Share this answer
 

Link worked for me.

Error 3024 Problem in Mapping Fragment. Must specify mapping for all key properties

your inner join would be:

Inner Join Countries on Countries.ID = CountryStates.CountryID ?

Mapping name issue perhaps ?

Call me chicken but I'd create a view and use that instead.

Not a great user of Entity Framework

Cheers.

 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900