Skip to content

Model Building: StackOverflowException when two properties share the same foreign key #6115

Closed
@ntsekouras

Description

@ntsekouras
public class FileRecord : RelativeEntity
    {
        public Guid DmsId { get; set; }
        public int EntityId { get; set; }
        public string MimeType { get; set; }
        public FileRecordEntity Entity { get; set; }

        [ForeignKey("EntityId")]
        public virtual Decision Decision { get; set; }
        [ForeignKey("EntityId")]
        public virtual Invitation Invitation { get; set; }
    }

Can i have two properties with the same foreign key?

EF Core version: 1.0.0
Operating system: Win10 64
Visual Studio version: VS2015

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions