Fauna v10 .NET/C# Driver 0.2.0-beta
 
Loading...
Searching...
No Matches
StreamSerializer.cs
Go to the documentation of this file.
1using Fauna.Mapping;
2using Fauna.Types;
4
5namespace Fauna.Serialization;
6
7
8internal class StreamSerializer : BaseSerializer<Stream>
9{
10 public override Stream Deserialize(MappingContext context, ref Utf8FaunaReader reader) =>
11 reader.CurrentTokenType switch
12 {
13 TokenType.Stream => reader.GetStream(),
14 _ => throw UnexpectedToken(reader.CurrentTokenType)
15 };
16
17 public override void Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
18 {
19 throw new NotImplementedException();
20 }
21}
A class representing the mapping context to be used during serialization and deserialization.
static SerializationException UnexpectedToken(TokenType token)
Represents a Fauna stream token.
Definition Stream.cs:7
Definition Client.cs:8