Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/Internal/ContextGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public string GetRelationshipName<TParent>(string relationshipName)
e.EntityType == entityType)
.Relationships
.FirstOrDefault(r =>
r.InternalRelationshipName.ToLower() == relationshipName.ToLower())
r.PublicRelationshipName.ToLower() == relationshipName.ToLower())
?.InternalRelationshipName;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<VersionPrefix>2.0.2</VersionPrefix>
<VersionPrefix>2.0.3</VersionPrefix>
<TargetFrameworks>netstandard1.6</TargetFrameworks>
<AssemblyName>JsonApiDotNetCore</AssemblyName>
<PackageId>JsonApiDotNetCore</PackageId>
Expand Down
4 changes: 3 additions & 1 deletion src/JsonApiDotNetCore/Services/EntityResourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public async Task<object> 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.");
Expand All @@ -116,7 +118,7 @@ public async Task<T> UpdateAsync(TId id, T entity)
public async Task UpdateRelationshipsAsync(TId id, string relationshipName, List<DocumentData> relationships)
{
relationshipName = _jsonApiContext.ContextGraph
.GetRelationshipName<T>(relationshipName.ToProperCase());
.GetRelationshipName<T>(relationshipName);

if (relationshipName == null)
throw new JsonApiException("422", "Relationship name not specified.");
Expand Down