Skip to content

Create an alternate key for join entity types which have an independent PK #21900

@ajcvickers

Description

@ajcvickers

Consider this many-to-many join type:

public class JoinType
{
        public virtual Guid Id { get; set; }
        public virtual int LeftId { get; set; }
        public virtual int RightId { get; set; }
}

When performing fixup, the state manager needs to lookup instance where LeftId and RightId match. This fast when these types form the composite PK of the type. In this case Id is the PK, and hence there isn't a way to do a fast lookup for matches of LeftId and RightId.

To fix this, we should create an alternate key for what would usually be the PK in the join table. However, we should likely only do this after #4073 is implemented to avoid making it impossible to change these values, although it does seem unlikely that changing them would be useful.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions