diff --git a/src/JsonApiDotNetCore/Internal/ContextGraph.cs b/src/JsonApiDotNetCore/Internal/ContextGraph.cs index fbf97cfc00..7881926c23 100644 --- a/src/JsonApiDotNetCore/Internal/ContextGraph.cs +++ b/src/JsonApiDotNetCore/Internal/ContextGraph.cs @@ -46,7 +46,7 @@ public string GetRelationshipName(string relationshipName) e.EntityType == entityType) .Relationships .FirstOrDefault(r => - r.InternalRelationshipName.ToLower() == relationshipName.ToLower()) + r.PublicRelationshipName.ToLower() == relationshipName.ToLower()) ?.InternalRelationshipName; } } diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj index bee09ee5d1..e142719fdb 100755 --- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -1,6 +1,6 @@  - 2.0.2 + 2.0.3 netstandard1.6 JsonApiDotNetCore JsonApiDotNetCore diff --git a/src/JsonApiDotNetCore/Services/EntityResourceService.cs b/src/JsonApiDotNetCore/Services/EntityResourceService.cs index f2c1ef777c..f287c905d4 100644 --- a/src/JsonApiDotNetCore/Services/EntityResourceService.cs +++ b/src/JsonApiDotNetCore/Services/EntityResourceService.cs @@ -92,6 +92,8 @@ public async Task GetRelationshipAsync(TId id, string relationshipName) if (relationshipName == null) throw new JsonApiException("422", "Relationship name not specified."); + _logger.LogTrace($"Looking up '{relationshipName}'..."); + var entity = await _entities.GetAndIncludeAsync(id, relationshipName); if (entity == null) throw new JsonApiException("404", $"Relationship {relationshipName} not found."); @@ -116,7 +118,7 @@ public async Task UpdateAsync(TId id, T entity) public async Task UpdateRelationshipsAsync(TId id, string relationshipName, List relationships) { relationshipName = _jsonApiContext.ContextGraph - .GetRelationshipName(relationshipName.ToProperCase()); + .GetRelationshipName(relationshipName); if (relationshipName == null) throw new JsonApiException("422", "Relationship name not specified.");