public override int Serialize(TSource source, SerializationContext context) { Guid value = GetValue(source); if (IsOptional && value == DefaultValue) { return(0); } return(WritePrefix(context) + ProtoGuid.Serialize(value, context, true)); }