Details
-
Task
-
Resolution: Duplicate
-
Major
-
None
-
None
-
None
-
2
-
SDK32, SDK34
Description
Motivation
-----------
In Java, most result classes have some helper methods such as ContentAsBytes (or ContentRaw), ContentAsJson, ContentAsString and ContentAs. In .NET we only have ContentAs<T>, and if no custom Transcoder/Serializer is passed by the user in the options, the JsonTranscoder with DefaultSerializer is used. This one does not support byte arrays, so there's no way for the .NET SDK to do result.ContentAs<bytes[]>() without passing a RawBinaryTranscoder in the operation's options.
But that's effectively correct behaviour from the SDK, since the JsonTranscoder has explicit handling to do:
if (typeof(T) == typeof(byte[]))
Chosen Fix
-----------
Add a ContentRaw() method to LookupInResult (internal class) and extend it inside ILookupInResultExtensions.cs.
Attachments
Issue Links
- depends on
-
NCBC-3465 Exist specs in LookupInResults do not return ContentAs
- Closed