Reputation: 2608
I'm trying to follow the ASP.NET Nerd Dinner tutorial of Microsoft, but I'm having problems with the linq-to-sql part.
I have the two databases Dinner and RSVP with primary keys and identity set to DinnerID
and RsvpID
. Then I created the relation FK_RSVP_Dinner
with foreign key RSVP.DinnerID
and pk Dinner.DinnerID
When creating the LinqToSql class and drag the two tables in, it creates the OneToMany relation successfully.
However, the NerdDinner.designer.cs file does not contain any collection called RSVPs, but only a variable RSVP.
What am I doing wrong?
Upvotes: 0
Views: 128
Reputation: 96
Couple of things to check:
Look in the NerdDinner.dbml's designer.cs file under the RSVP partial class definition and the Dinner partial class definition:
public partial class RSVP....
[Column(Storage="_RsvpID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
private EntityRef _Dinner;
Do the same for the Dinner partial class...
Hope that helps...
Upvotes: 1