1

I am declaring my reponse-dto like this:

[Route("/activity/sync", HttpVerb.Get)]
public class SyncActivityRequest : IReturn<SyncActivityResponse>
{
    public ICollection<SyncParam> ObjectsToSync { get; set; }
}

public class SyncActivityResponse
{
    public ICollection<KeyValuePair<Activity, SyncMetadata>> Result { get; set; }
}

The problem is ServiceStack does not serialize Activity and SyncMetadata because those are only type-arguments for another object (KeyValuePair in this case). Those two objects (activity and syncmetadata) both are declared in the same project.

How can I force the serialization of those two objects?

Thanks!

Marco Siffert
  • 485
  • 1
  • 4
  • 21

1 Answers1

1

You should avoid using interfaces or objects in DTOs, use a concrete Type like List<T> or T[] instead.

mythz
  • 138,929
  • 27
  • 237
  • 382