Class ValueObjectProtoSerializer<TSelf, TValue>
Namespace: AdCodicem.ValueObjects.ProtobufNet
Assembly: AdCodicem.ValueObjects.ProtobufNet.dll
Writes a value object as protobuf-net writes its underlying type at
public sealed class ValueObjectProtoSerializer<TSelf, TValue> : ISerializer<TSelf>, ISerializer<TSelf?> where TSelf : struct, IValueObject<TSelf, TValue>
Type Parameters
TSelf
Value object type.
TValue
Underlying value type.
Inheritance
object ← ValueObjectProtoSerializer<TSelf, TValue>
Implements
ISerializer<TSelf>, ISerializer<TSelf?>
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
The strict profile at protobuf-net's default level, [ProtoContract(Serializer = typeof(ValueObjectProtoSerializer<Sku, string>))].
Properties
Features
Indicates the features (including the default wire-type) for this type/serializer
public SerializerFeatures Features { get; }
Property Value
SerializerFeatures
Exceptions
protobuf-net has no inbuilt serializer for TValue.
Methods
Read(ref State, TSelf)
Deserialize an instance from the supplied writer
public TSelf Read(ref ProtoReader.State state, TSelf value)
Parameters
state ProtoReader.State
value TSelf
Returns
TSelf
Exceptions
ProtoException
The value read is one the inbuilt serializer of the underlying type cannot read, or one the value object refuses.
Write(ref State, TSelf)
Serialize an instance to the supplied writer
public void Write(ref ProtoWriter.State state, TSelf value)
Parameters
state ProtoWriter.State
value TSelf
Exceptions
ProtoException
value equals default(TSelf) and holds a value the value object rejects.