Fauna v10 .NET/C# Driver
1.0.1
Loading...
Searching...
No Matches
repo.git
Fauna
Serialization
EventSourceSerializer.cs
Go to the documentation of this file.
1
using
Fauna.Mapping
;
2
using
Fauna.Types
;
3
4
namespace
Fauna.Serialization
;
5
6
7
internal
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
}
Fauna.Mapping.MappingContext
A class representing the mapping context to be used during serialization and deserialization.
Definition
MappingContext.cs:10
Fauna.Types.EventSource
Represents a Fauna EventSource for initializing Streams and Feeds.
Definition
EventSource.cs:9
Fauna.Mapping
Definition
Attributes.cs:1
Fauna.Serialization
Definition
BaseRefSerializer.cs:5
Fauna.Serialization.Deserialize
object? ISerializer. Deserialize(MappingContext ctx, ref Utf8FaunaReader reader)
Consumes or partially consumes the provided reader and deserializes into a result.
Fauna.Serialization.Serialize
void ISerializer. Serialize(MappingContext context, Utf8FaunaWriter writer, object? o)
Serializes the provided object onto the Utf8FaunaWriter
Fauna.Serialization.FaunaType
FaunaType
An enum representing possible Fauna types.
Definition
FaunaType.cs:7
Fauna.Types
Definition
BaseRef.cs:3
Generated by
1.9.8