Fauna .NET Driver 0.1.0-beta
 
Loading...
Searching...
No Matches
CheckedDeserializer.cs
Go to the documentation of this file.
1using Fauna.Mapping;
2
4
5internal class CheckedDeserializer<T> : BaseDeserializer<T>
6{
7 public override T Deserialize(MappingContext context, ref Utf8FaunaReader reader)
8 {
9 var tokenType = reader.CurrentTokenType;
10 var obj = DynamicDeserializer.Singleton.Deserialize(context, ref reader);
11
12 if (obj is T v)
13 return v;
14 else
15 throw new SerializationException(
16 $"Unexpected token while deserializing: {tokenType}");
17 }
18}
Represents error that occur during serialization and deserialization of Fauna data.
Represents a reader that provides fast, non-cached, forward-only access to serialized data.