You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize if this issue exists already somewhere, but I couldn't find it.
I have two tables that represent many-to-many relationships between tables "Users" and "Skills". One for "required" skills and one for "preferred" skills. Each has a composite primary key using UserId, SkillId
CREATE TABLE [dbo].[UserRequiredSkill] (
[UserId] INT NOT NULL,
[SkillId] INT NOT NULL,
CONSTRAINT [PK_UserRequiredSkill] PRIMARY KEY CLUSTERED ([UserId], [SkillId]),
CONSTRAINT [FK_UserRequiredSkill_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]),
CONSTRAINT [FK_UserRequiredSkill_Skill] FOREIGN KEY ([SkillId]) REFERENCES [dbo].[Skill] ([SkillId])
);
CREATE TABLE [dbo].[UserPreferredSkill] (
[UserId] INT NOT NULL,
[SkillId] INT NOT NULL,
CONSTRAINT [PK_UserPreferredSkill] PRIMARY KEY CLUSTERED ([UserId], [SkillId]),
CONSTRAINT [FK_UserPreferredSkill_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([UserId]),
CONSTRAINT [FK_UserPreferredSkill_Skill] FOREIGN KEY ([SkillId]) REFERENCES [dbo].[Skill] ([SkillId])
);
However, the user table generates duplicate properties:
/// <summary>
/// Child Skills (Many-to-Many) mapped by table [UserPreferredSkill]
/// </summary>
public System.Collections.Generic.ICollection<SkillEntity> Skills_SkillId { get; set; } // Many to many mapping
/// <summary>
/// Child Skills (Many-to-Many) mapped by table [UserRequiredSkill]
/// </summary>
public System.Collections.Generic.ICollection<SkillEntity> Skills_SkillId { get; set; } // Many to many mapping
The skills table also has duplicate properties. Why is this? Couldn't it just use the pluralized many-to-many table names for the property names? As in:
public System.Collections.Generic.ICollection<SkillEntity> UserRequiredSkills { get; set; }
public System.Collections.Generic.ICollection<SkillEntity> UserPreferredSkills { get; set; }
Am I doing something wrong or is there a way to override this behavior so the code compiles?
The text was updated successfully, but these errors were encountered:
I apologize if this issue exists already somewhere, but I couldn't find it.
I have two tables that represent many-to-many relationships between tables "Users" and "Skills". One for "required" skills and one for "preferred" skills. Each has a composite primary key using
UserId, SkillId
However, the user table generates duplicate properties:
The skills table also has duplicate properties. Why is this? Couldn't it just use the pluralized many-to-many table names for the property names? As in:
Am I doing something wrong or is there a way to override this behavior so the code compiles?
The text was updated successfully, but these errors were encountered: