Skip to content

Commit be4fc39

Browse files
author
Bart Koelman
authored
Removed unused property RelationshipAttribute.EntityPropertyName (#670)
1 parent 7015b21 commit be4fc39

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class HasManyAttribute : RelationshipAttribute
1212
/// <param name="publicName">The relationship name as exposed by the API</param>
1313
/// <param name="relationshipLinks">Which links are available. Defaults to <see cref="Link.All"/></param>
1414
/// <param name="canInclude">Whether or not this relationship can be included using the <c>?include=public-name</c> query string</param>
15-
/// <param name="mappedBy">The name of the entity mapped property, defaults to null</param>
1615
///
1716
/// <example>
1817
///
@@ -25,8 +24,8 @@ public class HasManyAttribute : RelationshipAttribute
2524
/// </code>
2625
///
2726
/// </example>
28-
public HasManyAttribute(string publicName = null, Link relationshipLinks = Link.All, bool canInclude = true, string mappedBy = null, string inverseNavigationProperty = null)
29-
: base(publicName, relationshipLinks, canInclude, mappedBy)
27+
public HasManyAttribute(string publicName = null, Link relationshipLinks = Link.All, bool canInclude = true, string inverseNavigationProperty = null)
28+
: base(publicName, relationshipLinks, canInclude)
3029
{
3130
InverseNavigation = inverseNavigationProperty;
3231
}

src/JsonApiDotNetCore/Models/Annotation/HasOneAttribute.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public class HasOneAttribute : RelationshipAttribute
1414
/// <see cref="ILinksConfiguration"/> or <see cref="ResourceContext"/> is used.</param>
1515
/// <param name="canInclude">Whether or not this relationship can be included using the <c>?include=public-name</c> query string</param>
1616
/// <param name="withForeignKey">The foreign key property name. Defaults to <c>"{RelationshipName}Id"</c></param>
17-
/// <param name="mappedBy">The name of the entity mapped property, defaults to null</param>
1817
///
1918
/// <example>
2019
/// Using an alternative foreign key:
@@ -28,9 +27,8 @@ public class HasOneAttribute : RelationshipAttribute
2827
/// }
2928
/// </code>
3029
/// </example>
31-
public HasOneAttribute(string publicName = null, Link links = Link.NotConfigured, bool canInclude = true, string withForeignKey = null, string mappedBy = null, string inverseNavigationProperty = null)
32-
33-
: base(publicName, links, canInclude, mappedBy)
30+
public HasOneAttribute(string publicName = null, Link links = Link.NotConfigured, bool canInclude = true, string withForeignKey = null, string inverseNavigationProperty = null)
31+
: base(publicName, links, canInclude)
3432
{
3533
_explicitIdentifiablePropertyName = withForeignKey;
3634
InverseNavigation = inverseNavigationProperty;

src/JsonApiDotNetCore/Models/Annotation/RelationshipAttribute.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ namespace JsonApiDotNetCore.Models
77
{
88
public abstract class RelationshipAttribute : Attribute, IResourceField
99
{
10-
protected RelationshipAttribute(string publicName, Link relationshipLinks, bool canInclude, string mappedBy)
10+
protected RelationshipAttribute(string publicName, Link relationshipLinks, bool canInclude)
1111
{
1212
if (relationshipLinks == Link.Paging)
1313
throw new JsonApiSetupException($"{Link.Paging.ToString("g")} not allowed for argument {nameof(relationshipLinks)}");
1414

1515
PublicRelationshipName = publicName;
1616
RelationshipLinks = relationshipLinks;
1717
CanInclude = canInclude;
18-
EntityPropertyName = mappedBy;
1918
}
2019

2120
public string ExposedInternalMemberName => InternalRelationshipName;
@@ -49,7 +48,6 @@ protected RelationshipAttribute(string publicName, Link relationshipLinks, bool
4948
/// </summary>
5049
public Link RelationshipLinks { get; }
5150
public bool CanInclude { get; }
52-
public string EntityPropertyName { get; }
5351

5452
public abstract void SetValue(object entity, object newValue);
5553

0 commit comments

Comments
 (0)