Skip to content

Commit 6ab917f

Browse files
committed
#258 Removes extra ToString() on the span and fixes naming to be more accurate
1 parent a7d3390 commit 6ab917f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/JsonApiDotNetCore/Internal/Query/RelatedAttrFilterQuery.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ public RelatedAttrFilterQuery(
1515
{
1616
_jsonApiContext = jsonApiCopntext;
1717
var filterQueryAttribute = filterQuery.Attribute;
18-
var relationshipSubSpans = new SpanSplitter(ref filterQueryAttribute, '.');
19-
var relationship1 = relationshipSubSpans[0].ToString();
20-
var relationship2 = relationshipSubSpans[1].ToString();
21-
var relationship = GetRelationship(relationshipSubSpans[0].ToString());
18+
var filterQuerySubSpans = new SpanSplitter(ref filterQueryAttribute, '.');
19+
var subSpan1 = filterQuerySubSpans[0].ToString();
20+
var subSpan2 = filterQuerySubSpans[1].ToString();
21+
var relationship = GetRelationship(subSpan1);
2222
if (relationship == null)
23-
throw new JsonApiException(400, $"{relationship2} is not a valid relationship on {relationship1}.");
23+
throw new JsonApiException(400, $"{subSpan2} is not a valid relationship on {subSpan1}.");
2424

25-
var attribute = GetAttribute(relationship, relationship2);
25+
var attribute = GetAttribute(relationship, subSpan2);
2626

2727
if (attribute == null)
2828
throw new JsonApiException(400, $"'{filterQuery.Attribute}' is not a valid attribute.");

0 commit comments

Comments
 (0)