Skip to content

Commit 9f265fa

Browse files
committed
fix: var naming
1 parent 09697d8 commit 9f265fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/JsonApiDotNetCore/Middleware/IncomingTypeMatchFilter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ public void OnActionExecuting(ActionExecutingContext context)
3737
if (request.Method == HttpMethods.Patch || request.Method == HttpMethods.Post)
3838
{
3939
var deserializedType = GetDeserializedType(context);
40-
var expectedType = GetExpectedType();
40+
var targetType = GetTargetType();
4141

42-
if (deserializedType != null && expectedType != null && deserializedType != expectedType)
42+
if (deserializedType != null && targetType != null && deserializedType != targetType)
4343
{
44-
ResourceContext resourceFromEndpoint = _provider.GetResourceContext(expectedType);
44+
ResourceContext resourceFromEndpoint = _provider.GetResourceContext(targetType);
4545
ResourceContext resourceFromBody = _provider.GetResourceContext(deserializedType);
4646

4747
throw new ResourceTypeMismatchException(new HttpMethod(request.Method), request.Path, resourceFromEndpoint, resourceFromBody);
@@ -60,7 +60,7 @@ private Type GetDeserializedType(ActionExecutingContext context)
6060
return deserializedValue?.GetType();
6161
}
6262

63-
private Type GetExpectedType()
63+
private Type GetTargetType()
6464
{
6565
if (_jsonApiRequest.Kind == EndpointKind.Primary)
6666
{

0 commit comments

Comments
 (0)