-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
I have problem if class has property ICollection<SomeClass> foo and this property has attribute [SerializeAs(SerializeAsOptions.Embedded)]. There is switch with case SerializeAsOptions.Embedded in JsonApiFormatter.Serialize(..).
That case contains:
this.Serialize(prop.GetValue(value, null), writeStream, writer, serializer, aggregator);
But property should be serialized as many.
There could be something like that:
var propValue = prop.GetValue(value, null);
if (_modelManager.IsSerializedAsMany(propValue.GetType()))
this.SerializeMany(propValue, writeStream, writer, serializer, aggregator);
else
this.Serialize(propValue, writeStream, writer, serializer, aggregator);