Fauna .NET Driver 0.1.0-beta
 
Loading...
Searching...
No Matches
NumberDeserializers.cs
Go to the documentation of this file.
1using Fauna.Mapping;
2
3namespace Fauna.Serialization;
4
5internal class LongDeserializer : BaseDeserializer<long>
6{
7 public override long Deserialize(MappingContext context, ref Utf8FaunaReader reader) =>
8 reader.CurrentTokenType switch
9 {
10 TokenType.Int => reader.GetInt(),
11 TokenType.Long => reader.GetLong(),
12 _ => throw new SerializationException(
13 $"Unexpected token while deserializing: {reader.CurrentTokenType}"),
14 };
15}
T Deserialize(MappingContext context, ref Utf8FaunaReader reader)