Fauna v10 .NET/C# Driver 1.0.0
 
Loading...
Searching...
No Matches
EventSourceSerializer.cs
Go to the documentation of this file.
1using Fauna.Mapping;
2using Fauna.Types;
3
4namespace Fauna.Serialization;
5
6
7internal class EventSourceSerializer : BaseSerializer<EventSource>
8{
9 public override List<FaunaType> GetSupportedTypes() => new List<FaunaType> { FaunaType.Null, FaunaType.Stream };
10
11 public override EventSource Deserialize(MappingContext ctx, ref Utf8FaunaReader reader) =>
12 reader.CurrentTokenType switch
13 {
14 TokenType.EventSource => reader.GetEventSource(),
15 _ => throw UnexpectedToken(reader.CurrentTokenType)
16 };
17
18 public override void Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
19 {
20 throw new NotImplementedException();
21 }
22}
A class representing the mapping context to be used during serialization and deserialization.
Represents a Fauna EventSource for initializing Streams and Feeds.
Definition EventSource.cs:9
object? ISerializer. Deserialize(MappingContext ctx, ref Utf8FaunaReader reader)
Consumes or partially consumes the provided reader and deserializes into a result.
void ISerializer. Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
Serializes the provided object onto the Utf8FaunaWriter
FaunaType
An enum representing possible Fauna types.
Definition FaunaType.cs:7