Skip to content

Commit be99234

Browse files
committed
Add missing nameof() in thrown ArgumentException
1 parent 75c056c commit be99234

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/JsonApiDotNetCore/Configuration/ResourceGraph.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private IReadOnlyCollection<TField> FilterFields<TResource, TField>(Expression<F
130130

131131
if (matchingField == null)
132132
{
133-
throw new ArgumentException($"Member '{memberName}' is not exposed as a JSON:API field.");
133+
throw new ArgumentException($"Member '{memberName}' is not exposed as a JSON:API field.", nameof(selector));
134134
}
135135

136136
matches.Add(matchingField);
@@ -178,8 +178,9 @@ private IEnumerable<string> ToMemberNames<TResource>(Expression<Func<TResource,
178178
}
179179
else
180180
{
181-
throw new ArgumentException($"The expression '{selector}' should select a single property or select multiple properties into an anonymous type. " +
182-
"For example: 'article => article.Title' or 'article => new { article.Title, article.PageCount }'.");
181+
throw new ArgumentException(
182+
$"The expression '{selector}' should select a single property or select multiple properties into an anonymous type. " +
183+
"For example: 'article => article.Title' or 'article => new { article.Title, article.PageCount }'.", nameof(selector));
183184
}
184185
}
185186

0 commit comments

Comments
 (0)