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

Removed unused property RelationshipAttribute.EntityPropertyName #670

merged 1 commit into from
Feb 11, 2020

Conversation

bart-degreed
Copy link
Contributor

Fixes #649.

Related to this, I found that HasManyThroughAttribute has a constructor parameter named mappedBy, whose value is passed to the base class string parameter called inverseNavigationProperty. I wonder if that is correct (sounds like something else entirely), but will leave that up to reviewers to decide.

Also note that the inverseNavigationProperty parameter is missing in the constructor documentation parameter list.

Copy link
Member

@maurei maurei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks again for your input. I believe the mappedBy parameter is an artifact of the Entity-Resource split feature that was removed in v4. I think it was consumed by an AutoMapper in the case that the mapping was non-trivial. Thanks for removing this.

As to your other comment: I didn't see any mappedBy being passed along as inverseNavigation in HasManyThroughAttribute. Can you double check and link me to the exact line of code if I overlooked it? As soon as you get back to about that me I'll merge it.

@maurei
Copy link
Member

maurei commented Feb 11, 2020

About the missing doc for inverseNavigationProperty: I'll add that in a separate PR once this has been merged (it would have been easier for me to add that adjustment if you create a branch in this repo instead of your fork -- I'm not sure if that requires any rights you don't have?)

@bart-degreed
Copy link
Contributor Author

It is located at: https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Models/Annotation/HasManyThroughAttribute.cs#L46-L47

In the image below, Resharper shows the parameter name (inverseNavigationProperty) with argument mappedby being passed for it.

image

I do not think I have permission to create a branch on this repo. But if you tell me what to change, I'll push it to this PR.

@maurei
Copy link
Member

maurei commented Feb 11, 2020

That looks like some weird behaviour of ReSharper. In the link you provided, the mappedBy parameter is passed as the 4th parameter to the base constructor, which is actually the base mappedBy parameter, not inverseNavigationProperty as displayed in your screenshot. Unless I'm completely missing something here?

I'm assuming it's alright and will proceed merging.

@maurei maurei merged commit be4fc39 into json-api-dotnet:master Feb 11, 2020
@bart-degreed
Copy link
Contributor Author

bart-degreed commented Feb 11, 2020

Sorry for the confusion. The link pointed to the master branch, while the screenshot came from the PR branch. In master, the base class has 5 parameters, but in the PR it has 4. This looks like a refactoring mistake from my side. Let me create another PR to fix that.

@bart-degreed bart-degreed deleted the remove-EntityPropertyName branch February 11, 2020 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Unused relationship property
2 participants