Skip to content

Support for Self-Referencing ManyToMany Relationships #790

Closed
@askvortsov1

Description

@askvortsov1

Description

  • When trying to use HasManyThrough on a self-referencing ManyToMany relationship, an error is thrown. This is because SingleOrDefault is used to find the left and right joining properties:
    hasManyThroughAttribute.LeftProperty = throughProperties.SingleOrDefault(x => x.PropertyType == entityType)
    . A special case should be added if the property annotated by HasManyThrough is an IEnumerable of the same type as the current class.

Environment

  • JsonApiDotNetCore Version: v4.0.0-alpha5
  • Other Relevant Package Versions: Asp Net Core 3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions