So, I was really frustrated with this issue because I don't really know what is going on. For the first part I have already created tests that certifies that the FastDeserializer is working perfectly even when I put the byte array inside a ByteArrayContent in a HttpResponseMessage, getting the content with the ReadAsByteArrayAsync() getting a simple byte[] object, that is perfect and that works. But, for some reason, if I do the same with with a REST API, when I am on the client and try to deserialize the binary content of the response I get the next exception:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Arg_ParamName_Name
Source=System.Private.CoreLib
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
at SD.LLBLGen.Pro.ORMSupportClasses.FastDeserializer.ReadEntityMemberCollections(EntityBase2 entity)
at SD.LLBLGen.Pro.ORMSupportClasses.FastDeserializer.ReadReferencedEntities(EntityBase2 rootEntity)
at SD.LLBLGen.Pro.ORMSupportClasses.FastDeserializer.Deserialize(IFastSerializableEntityCollection2 collection)
at VoyageViewer.Shared.Services.JsonService.<ExecuteRestBinaryGet>d__3`1.MoveNext() in D:\git\cms_uno\src\VoyageViewer\VoyageViewer\VoyageViewer.Shared\Services\JsonService.cs:line 43
So, what could I be doing wrong?. I mean, I know the FastDeserializer works, but what could happening that provoques this error on the client?.
Thanks