From 7e9dfeb169c8882b5f68ab2442a99d84c35cd3a3 Mon Sep 17 00:00:00 2001 From: Nick Miller Date: Thu, 29 Dec 2016 13:11:11 -0600 Subject: [PATCH] Fixed issue serialization bug Fixed an issue where serialization fails if a model contains multiple linked entities of the same type. --- src/NJsonApiCore/ResourceMapping.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NJsonApiCore/ResourceMapping.cs b/src/NJsonApiCore/ResourceMapping.cs index 1c84d16..85af5b8 100644 --- a/src/NJsonApiCore/ResourceMapping.cs +++ b/src/NJsonApiCore/ResourceMapping.cs @@ -60,7 +60,7 @@ public bool ValidateIncludedRelationshipPaths(string[] includedPaths) var parts = relationshipPath.Split('.'); foreach (var part in parts) { - var relationship = currentMapping.Relationships.SingleOrDefault(x => x.RelatedBaseResourceType == part); + var relationship = currentMapping.Relationships.FirstOrDefault(x => x.RelatedBaseResourceType == part); if (relationship == null) return false; @@ -93,4 +93,4 @@ public Dictionary GetValuesFromAttributes(Dictionary