public Expression Deserialize(FormatContext context) => ReadMethod != null ? Expression.Call(context.Buffer, ReadMethod) : throw new InvalidOperationException($"No deserializator method was found for type {Type.FullName}");
Expression ITypeFormat.Deserialize(FormatContext context) => Expression.Call(Expression.Constant(this), nameof(Deserialize), null, context.Buffer);
/// <summary> /// Shortcut for <c>context.Read(typeof(T))</c> /// </summary> public static Expression Read <T>(this FormatContext context) => context.Read(typeof(T));
public abstract Expression Deserialize(FormatContext context);
/// <summary> /// Shortcut for <c>context.GetFormat(type).Deserialize(context.WithType(type))</c> /// </summary> public static Expression Read(this FormatContext context, Type type) => context.Formats.Get(type).Deserialize(context.WithType(type));