Skip to content

Commit 343ff01

Browse files
author
Chris Santero
committed
use model manager method to determine if relationship is to-many
1 parent c2fb45d commit 343ff01

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

JSONAPI/Json/JsonApiFormatter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,7 @@ private void DeserializeLinkedResources(object obj, JsonReader reader)
797797
PropertyInfo prop = _modelManager.GetPropertyForJsonKey(objectType, value);
798798
if (prop != null && !prop.PropertyType.CanWriteAsJsonApiAttribute())
799799
{
800-
//FIXME: We're really assuming they're ICollections...but testing for that doesn't work for some reason. Break prone!
801-
if (prop.PropertyType.GetInterfaces().Contains(typeof(IEnumerable)) && prop.PropertyType.IsGenericType)
800+
if (_modelManager.IsSerializedAsMany(prop.PropertyType))
802801
{
803802
// Is a hasMany
804803

0 commit comments

Comments
 (0)