Skip to content

Removed unused property RelationshipAttribute.EntityPropertyName #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/JsonApiDotNetCore/Models/Annotation/HasManyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class HasManyAttribute : RelationshipAttribute
/// <param name="publicName">The relationship name as exposed by the API</param>
/// <param name="relationshipLinks">Which links are available. Defaults to <see cref="Link.All"/></param>
/// <param name="canInclude">Whether or not this relationship can be included using the <c>?include=public-name</c> query string</param>
/// <param name="mappedBy">The name of the entity mapped property, defaults to null</param>
///
/// <example>
///
Expand All @@ -25,8 +24,8 @@ public class HasManyAttribute : RelationshipAttribute
/// </code>
///
/// </example>
public HasManyAttribute(string publicName = null, Link relationshipLinks = Link.All, bool canInclude = true, string mappedBy = null, string inverseNavigationProperty = null)
: base(publicName, relationshipLinks, canInclude, mappedBy)
public HasManyAttribute(string publicName = null, Link relationshipLinks = Link.All, bool canInclude = true, string inverseNavigationProperty = null)
: base(publicName, relationshipLinks, canInclude)
{
InverseNavigation = inverseNavigationProperty;
}
Expand Down
6 changes: 2 additions & 4 deletions src/JsonApiDotNetCore/Models/Annotation/HasOneAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class HasOneAttribute : RelationshipAttribute
/// <see cref="ILinksConfiguration"/> or <see cref="ResourceContext"/> is used.</param>
/// <param name="canInclude">Whether or not this relationship can be included using the <c>?include=public-name</c> query string</param>
/// <param name="withForeignKey">The foreign key property name. Defaults to <c>"{RelationshipName}Id"</c></param>
/// <param name="mappedBy">The name of the entity mapped property, defaults to null</param>
///
/// <example>
/// Using an alternative foreign key:
Expand All @@ -28,9 +27,8 @@ public class HasOneAttribute : RelationshipAttribute
/// }
/// </code>
/// </example>
public HasOneAttribute(string publicName = null, Link links = Link.NotConfigured, bool canInclude = true, string withForeignKey = null, string mappedBy = null, string inverseNavigationProperty = null)

: base(publicName, links, canInclude, mappedBy)
public HasOneAttribute(string publicName = null, Link links = Link.NotConfigured, bool canInclude = true, string withForeignKey = null, string inverseNavigationProperty = null)
: base(publicName, links, canInclude)
{
_explicitIdentifiablePropertyName = withForeignKey;
InverseNavigation = inverseNavigationProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ namespace JsonApiDotNetCore.Models
{
public abstract class RelationshipAttribute : Attribute, IResourceField
{
protected RelationshipAttribute(string publicName, Link relationshipLinks, bool canInclude, string mappedBy)
protected RelationshipAttribute(string publicName, Link relationshipLinks, bool canInclude)
{
if (relationshipLinks == Link.Paging)
throw new JsonApiSetupException($"{Link.Paging.ToString("g")} not allowed for argument {nameof(relationshipLinks)}");

PublicRelationshipName = publicName;
RelationshipLinks = relationshipLinks;
CanInclude = canInclude;
EntityPropertyName = mappedBy;
}

public string ExposedInternalMemberName => InternalRelationshipName;
Expand Down Expand Up @@ -49,7 +48,6 @@ protected RelationshipAttribute(string publicName, Link relationshipLinks, bool
/// </summary>
public Link RelationshipLinks { get; }
public bool CanInclude { get; }
public string EntityPropertyName { get; }

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

Expand Down