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